Nested if statements

Huey462

Board Regular
Joined
Jul 25, 2011
Messages
147
I am having a hard time wrapping my head around the error here and I hope someone can help me out.</SPAN></SPAN>

I am trying to calculate how many days until an employee’s annual performance report is due, and display it in days. The formula works great for the overdues, but those that are not overdue are showing up as “#NUM!”. The first question (the easy one) is how can I replace the “#NUM!” with “0”? The date of the last evaluation close out date is in Column C</SPAN></SPAN>

=IF(C2<=TODAY()<=0,0,DATEDIF(C2,TODAY(),"d"))</SPAN></SPAN>

The second, and harder question, is how can I make a nested IF to do one of 3 actions:</SPAN></SPAN>
If the due date is past, display “-## (Past Due)</SPAN></SPAN>
If the due date is within 30 days, display “## (Coming Due)”</SPAN></SPAN>
If the due date is more than 30 days, display “##”</SPAN></SPAN>

Thanks in advance</SPAN></SPAN>

-Huey</SPAN></SPAN>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about this:

=IF(C2-NOW()<0,INT(C2-NOW())&" (Past Due)",IF(C2-NOW()<30,INT(C2-NOW())&" (Coming Due)",INT(C2-NOW())))
 
Upvote 0
As always, the responses are outstanding and work like a charm.</SPAN>

Thank you so much</SPAN></SPAN>
 
Upvote 0

Forum statistics

Threads
1,214,542
Messages
6,120,116
Members
448,945
Latest member
Vmanchoppy

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