0
votes

I am trying to show in an Excel table column Yes or No if the date difference between two dates is greater or less than 2 days. If the difference is 2 days or greater I would like it to show "Yes". If it is 1 day or less I would like it to show "No". I have used the following formula:

=IF(DATEDIF(C5,D5,"d")>=2,"Yes"<=2,"No")

It correctly shows the "No" but where it is meant to be "Yes" it has shown "FALSE".

2

2 Answers

2
votes

This should do it for you:

=IF(D5-C5>2,"Yes","No")
0
votes

Try this simple change. The logical expression only resides in your first argument. The other two are what the formula should display given the results of the logical expression.

=IF(DATEDIF(C5,D5,"d")>=2,"Yes","No")