I have the formula for the duration of months between 2 dates. However, I need to add 1 month if the end month days is greater than the beginning month. See below for example;
I tried using EOMONTH, but that doesn't seem to do what I need it to. The following Code goes in the Months Required.
[TABLE="width: 500"]
<TBODY>[TR]
[TD]EASCO=[/TD]
[TD][/TD]
[TD]19-Mar-19[/TD]
[/TR]
[TR]
[TD]ECC[/TD]
[TD]EAS[/TD]
[TD]Months Required[/TD]
[/TR]
[TR]
[TD]2-Feb-19[/TD]
[TD]2-Feb-19[/TD]
[TD]1 (needs to be 2 since the day in Mar (19) is greater than the day in Feb (2).[/TD]
[/TR]
[TR]
[TD]21-Jan-19[/TD]
[TD]5-Feb-19[/TD]
[TD]2 (Correct)[/TD]
[/TR]
</TBODY>[/TABLE]
I tried using EOMONTH, but that doesn't seem to do what I need it to. The following Code goes in the Months Required.
Code:
=IF([@ECC]=[@EAS],DATEDIF([@EAS],EOMONTH(EASCO,0),"M"),DATEDIF([@ECC],EOMONTH(EASCO,0),"M"))
<TBODY>[TR]
[TD]EASCO=[/TD]
[TD][/TD]
[TD]19-Mar-19[/TD]
[/TR]
[TR]
[TD]ECC[/TD]
[TD]EAS[/TD]
[TD]Months Required[/TD]
[/TR]
[TR]
[TD]2-Feb-19[/TD]
[TD]2-Feb-19[/TD]
[TD]1 (needs to be 2 since the day in Mar (19) is greater than the day in Feb (2).[/TD]
[/TR]
[TR]
[TD]21-Jan-19[/TD]
[TD]5-Feb-19[/TD]
[TD]2 (Correct)[/TD]
[/TR]
</TBODY>[/TABLE]