Forum Discussion
qdanazumi
Aug 11, 2022Copper Contributor
calculating months between two dates with rounding
I have been trying to look for the number between these two months while rounding to the next month if the day passes the 15th
- Aug 11, 2022
With dates in A3 and B3:
=(12*YEAR(B3)+MONTH(B3)+(DAY(B3)>15))-(12*YEAR(A3)+MONTH(A3)+(DAY(A3)>15))
NikolinoDE
Aug 11, 2022Platinum Contributor
That's right, you're absolutely right...strange...I have to find out why this is happening.
Qdanazumi: Please use Mr. Hans Vogelaar's formula and ignore mine.
sry for the circumstances.
Qdanazumi: Please use Mr. Hans Vogelaar's formula and ignore mine.
sry for the circumstances.
HansVogelaar
Aug 11, 2022MVP
It's because you subtract two month numbers without taking the year into account, so the result will vary from 1-12 = -11 to 12-1 = 11.