# formula to subtract dates with an if clause

#### zbz826

##### New Member
Need a quick formula if anyone can help - any help is appreciated

Here's the scenario:

Column A contains past and future dates
Column B contains today's date with the formula =TODAY()

I need a formula in Column C that will give me how many days have passed since the past dates in Column A while leaving a blank if Column A contains a future date.

For example, the end product would look like this:

Col A Col B Col C
10/11/06 10/12/06 1
10/10/06 10/11/06 2
11/2/06 10/11/06
10/1/06 10/11/06 10

Anyone? I'm terrible with IF clauses but need to get this together for a meeting this afternoon - sorry for the rush!!

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

##### Well-known Member
Hello,

do you mean

Code:
``=IF(A1>TODAY(),"",B1-A1)``

#### zbz826

##### New Member
You are a SAINT!!! Thank you! I think this will work perfectly!!

#### bakerman

##### Board Regular
I fairly new to excel, but this is how i would do it. In cell D1 put in =today()
then in Cell C1 put the following formula and copy it down
=IF(A1<=\$D\$1,DAYS360(A1,\$D\$1),"")

#### zbz826

##### New Member
thank you, bakerman, appreciate the help!

Replies
9
Views
147
Replies
2
Views
82
Replies
25
Views
874
Replies
0
Views
111
Replies
5
Views
582

1,141,913
Messages
5,709,298
Members
421,625
Latest member
renrut_5

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