# 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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

##### 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
5
Views
70
Replies
3
Views
137
Replies
2
Views
49
Replies
3
Views
123
Replies
5
Views
158