The formula is correct - a halving occurs every 210000 blocks. If the average time between each block is exactly 10 minutes, you wind up with a total time of about 3.995 years.
However, if blocks are mined slightly slower, you will take slightly longer than 4 years - if they are mined faster than 10 minutes, it'll take less than 4 years to get to the next ...
is something else going on?
AFAIK Mining nodes don't synchronize time. Timestamps in blocks are not accurate. You cannot tell the elapsed time between two blocks by looking at timestamps in those blocks.
The shortest time between 2 blocks is impossible to give since the timestamp of a block is not that strict, since its not important to record the timestamp more accurately than to the second.
The reason for negative times between some blocks is not due to timestamps of blocks being "non strict" or whatever silly stuff above posters said. I can't give you ...