# Nested if statements

#### Huey462

##### Board Regular
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>

-Huey</SPAN></SPAN>

### Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### par60056

##### Well-known Member

=IF(C2-NOW()<0,INT(C2-NOW())&" (Past Due)",IF(C2-NOW()<30,INT(C2-NOW())&" (Coming Due)",INT(C2-NOW())))

#### Huey462

##### Board Regular
As always, the responses are outstanding and work like a charm.</SPAN>

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

Replies
0
Views
264
Replies
1
Views
290
Replies
7
Views
307
Replies
13
Views
412
Replies
2
Views
593

1,195,672
Messages
6,011,084
Members
441,581
Latest member
rp4717

### 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.

### Which adblocker are you using?

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

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