# IF forumla on cell that sometimes blank, sometimes a date

#### JohnnyPicnic

##### New Member
Hi all,

I'm attempting to perform and IF statement against a cell that is sometimes blank and sometimes contains a date. The expected result is:
blank = leave blank
greater than 30 days = Data↑
between 15-30 days = Data↓

my formula =IF(TODAY()-D7>30, "Data↑", IF(AND(TODAY()-D7>=15, TODAY()-D7<=30), "Data↓",""))

I can't get to a formula that leaves the cell blank.

### Excel Facts

Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

#### Fluff

##### MrExcel MVP, Moderator
Excel Formula:
``=IF(D7="","",IF(TODAY()-D7>30, "Data↑", IF(AND(TODAY()-D7>=15, TODAY()-D7<=30), "Data↓","")))``

#### JohnnyPicnic

##### New Member
Excel Formula:
``=IF(D7="","",IF(TODAY()-D7>30, "Data↑", IF(AND(TODAY()-D7>=15, TODAY()-D7<=30), "Data↓","")))``
Thank you! I had tried something similar but I think I missed space or comma somewhere.

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
6
Views
296
Replies
3
Views
116
Replies
4
Views
242
Replies
3
Views
80
Replies
1
Views
334

1,129,568
Messages
5,637,094
Members
416,957
Latest member
Brovashift

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