If error datedif statement question

deezone13

New Member
Joined
Jul 13, 2016
Messages
2
Hi,

I have a spreadsheet where I need to return a value for files with a due date within the next 7 days as Yes, Past due as "" and dates greater than 7 days return a "Future date"). current formula :

=IFERROR((DATEDIF(TODAY(),M2,"D")<=7),""), brings back Blanks for past due, True for <+7 days, False for +8 days.

Please tell me how I can return "Yes" for <=7Days, and "Future Date" for +8 days.

Pretty sure just a nested if, and I have tried multiple times with different results but closest I come is the way it is now. but I have not been able to get it to work.

Thank you for your assistance.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Welcome to the forum.

Maybe:

=IF(M2-TODAY()<0,"",IF(M2-TODAY()<=7,"Yes","Future Date"))
 
Upvote 0
Yes sir that does work, and now I am wondering why I didn't do a nested if in the first place, Hmmm. Thanks for the assistance.
 
Upvote 0
Looks like you already have solution, but just FYI

Datedif was erroring (therefor trapped by iferror and returing "") because it expectes the 2nd date (M2) to be Equal to or Greater than The 1st date (Today)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top