# Date in if statment

#### kings21

##### Board Regular
How do I enter a date in an if statement? I need to calculate cost directly associated with a workers wage. They got a raise on a certain date so if it's before that date i need to multiply by 23 and after by 24. I tried this but it doesn’t seem to be working.

=IF(C40>4/30/2008,IF(D39=""," -",IF(D39="J",F39*24.5,IF(D39="D",F39*27.5,IF(D39="F",F39*23,IF(D39="An",F39*27,IF(D39="Al",F39*14)))))),IF(D35=""," -",IF(D35="J",F35*24.5,IF(D35="D",F35*27.5,IF(D35="F",F35*22,IF(D35="An",F35*27,IF(D35="Al",F35*14)))))))

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

#### Jonmo1

##### MrExcel MVP
Written like that, excel reads it like

iF C40 > (4 Devided by 30 devided by 2008)

Couple ways to do it..
If(C40>"4/30/2008"*1
or
If(C40>DATE(2008,4,30)
or
IF(C40>A1 'Where A1 = 4/30/2008

Hope this helps...

#### Kelbo

##### Board Regular
Hi kings21,

One problem is that nested 'if' statements are limited to 7 'ifs'.

Kelbo

#### kings21

##### Board Regular
Awesome!! Used the second one and it worked perfectly!! Thank you so much.

Replies
0
Views
249
Replies
4
Views
304
Replies
1
Views
189
Replies
0
Views
111
Replies
41
Views
1K

1,190,851
Messages
5,983,229
Members
439,832
Latest member
Kephart87

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