Thanks Ravinder, but it is strange that when I removed the 'a' in the formula, many objects came up with #MULTIVALUE error, while correct time came only for certain rows. Somehow, the 'a' seems to do the trick, as only after using that, I was able to get the correct values for all the records.
Regards,
G.