Users enter two dates. The formula needs to determine the number of months beginning with the first date and ending with the second. 5 months or less should return a "S". Greater than 5 months should return a "L".
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Start Date (A1)[/TD]
[TD]End Date (B1)[/TD]
[TD]S or L (C1)[/TD]
[/TR]
[TR]
[TD]10/09/2013[/TD]
[TD]03/08/2014[/TD]
[TD]L[/TD]
[/TR]
</tbody>[/TABLE]
C1 Formula:
=IF((YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)>=5,"L",IF((B1)-(A1)>=1,"S","0"))
The problem is the above dates represent 5 months so it should result in a S, but it's showing a L.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Start Date (A1)[/TD]
[TD]End Date (B1)[/TD]
[TD]S or L (C1)[/TD]
[/TR]
[TR]
[TD]10/09/2013[/TD]
[TD]03/08/2014[/TD]
[TD]L[/TD]
[/TR]
</tbody>[/TABLE]
C1 Formula:
=IF((YEAR(B1)-YEAR(A1))*12+MONTH(B1)-MONTH(A1)>=5,"L",IF((B1)-(A1)>=1,"S","0"))
The problem is the above dates represent 5 months so it should result in a S, but it's showing a L.
Last edited: