So I am trying to find a formula for excel. Bascically I have two dates and I need to know the number of months between them. But to add complexity, I need a rule in there that if the earlier date is the 1st to 15th it will be a whole month but if it is 16th to end of the month it will be a half month.
For example: Date 1: April 4, 2012 Date 2: December 31, 2012 Answer: Number of months would be 9 months
If Date 1 was April 16, 2012, with the same Date 2 of December 31, 2012, then the number of months would equal 8.5.
Can anyone help me with this one? You help would be greatly appreciated. many thanks
Answer
Assuming the dates are in G8, H8
=DATEDIF(G8, H8, "m") +1 -IF(DAY(G8) <16,0, 0.5)
No comments:
Post a Comment