# If Then statement with dates

#### mgallandt

##### New Member
New member, first post, novice excel user:

Here is my if then - IF('Cost of Acq Funds (Invst Proft)'!B4>0,('Cost of Acq Funds (Invst Proft)'!B4-'Cost of Acq Funds (Invst Proft)'!B3),((now)-'Cost of Acq Funds (Invst Proft)'!B3))

where B3 = 3/7/2013
B4 = 4/26/2013 or blank<blank>

In english: I want to capture the difference in days between B3 and B4, or if I leave B4 blank, the day I'm looking at the spreadsheet's date.

I speculate my problem is with logical test (B4>0). How do I identify if B4 is left blank, to use NOW - B3?

This will give me a days in inventory # necessary for my investment proforma spreadsheet.

Thanks for any help.

Mark</blank>

### Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
When you say NOW, do you mean the worksheet function NOW()? If you want number of days you probably want to use TODAY() instead.

Perhaps:

=IF('Cost of Acq Funds (Invst Proft)'!B4="",TODAY()-'Cost of Acq Funds (Invst Proft)'!B3,'Cost of Acq Funds (Invst Proft)'!B4-'Cost of Acq Funds (Invst Proft)'!B3)

=IF(ISBLANK('Cost of Acq Funds (Invst Proft)'!B4),((now)-'Cost of Acq Funds (Invst Proft)'!B3),('Cost of Acq Funds (Invst Proft)'!B4-'Cost of Acq Funds (Invst Proft)'!B3))

Replies
4
Views
261
Replies
3
Views
428
Replies
0
Views
334
Replies
1
Views
820
Replies
1
Views
991

1,202,987
Messages
6,052,939
Members
444,616
Latest member
novit19089

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