Are there any situations where you can only memorize rather than understand? I realize that you should understand theorems, equations etc. rather than just memorizing them, but are there any circumstances where memorizing in necessary? (I have always considered math a logical subject, where every fact can be deducted using logic rather than through memory)

A certain amount of RAM is required to do mathematics at all.  Otherwise you would spend too much time reinventing the wheel.  Euler was known for having a great memory.
That being said, I think it's possible to understand most parts of mathematics.  Which btw Leibniz took to mean that you could answer as many questions as someone might ask.
However, I think there are situations where understanding can be quite difficult, if not impossible. 
For instance, one of my favorite subjects, number theory, contains various examples of this.  Take one of my favorite functions, Euler's totient function.  It's both fairly easy to work with, and quite elusive all at once.  Just look at its graph.
Or the ABC conjecture.  Simple but elusive.  Or Goldbach's conjecture.
The Riemann-zeta function remains elusive too.
Fermat's last theorem turned out pretty elusive, judging from the length of the proof, and how long it went unsolved.
The Poincaré conjecture.  The continuum hypothesis.  Now I've reverted to listing famous problems.  But they were each pretty difficult. 
