Link to home
Start Free TrialLog in
Avatar of Allen Pitts
Allen PittsFlag for United States of America

asked on

Compare date to TODAY and Write text if greater than two

Hello expert,

A list of dates  
Opened
7/7/2021
7/12/2021
7/14/2021
7/16/2021
7/16/2021

displays when the ticket was opened in column D.
Have developed formula =DATEDIF(D2,TODAY(),"d") that writes a column the number of days the ticket as been open. Cool.
Now, would like to  write something in the column based if the number of days the ticket has been open is greater than two days. Tried
=IF((DATEDIF(D2,TODAY(),"d")>2,"more than two","less than two")
This returns "There is a problem with this formula"
The formula is based on the model
=IF(Cell D2 >= Cell E2, "Yes it is","No it isn't")
but not sure if a DATEDIF can be used in an IF.

What is the best way to do this?

Thanks.

Allen in Dallas



Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Too many brackets:

=IF(DATEDIF(D2,TODAY(),"d")>2,"more than two","less than two")

Shorter:
=IF(DATEDIF(D2,TODAY(),"d")>2,"more","less")&" than two"
ASKER CERTIFIED SOLUTION
Avatar of Rob Henson
Rob Henson
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial