Jon von der Heyden
MrExcel MVP, Moderator
- Joined
- Apr 6, 2004
- Messages
- 10,907
- Office Version
- 365
- Platform
- Windows
Hi
In cell C1 I have a start date (this could be blank).
In cell D1 I have an end date (also could be blank).
I would like to work out the difference in months between the end date and the start date.
however...
If the start/end date DAY is less than 15 then I want to consider it a full month.
If the start/end date DAY is greater than or equal to 15 then I do not want to consider the month.
I have the following to work out the difference but it's big and ugly and I figure there must be a slicker method.
Any help / suggestions appreciated
Regards
Jon
In cell C1 I have a start date (this could be blank).
In cell D1 I have an end date (also could be blank).
I would like to work out the difference in months between the end date and the start date.
however...
If the start/end date DAY is less than 15 then I want to consider it a full month.
If the start/end date DAY is greater than or equal to 15 then I do not want to consider the month.
I have the following to work out the difference but it's big and ugly and I figure there must be a slicker method.
Code:
=IF($D3="",13-IF(DAY(C3)>15,MONTH($C3)+1,MONTH(C3)),IF(D3>15,MONTH($D3)+1,MONTH(D3))-IF(DAY(C3)>15,MONTH($C3)+1,MONTH(C3)))
Any help / suggestions appreciated
Regards
Jon