Date Math

M

metaltecks

I have 2 columns, ADM and DISC. These are both date fields in the format of
6/20/2006.

In a column next to these 2 columns, I want to create a formula that will
check the difference between the 2 dates. If the date difference reaches 30
days, I would like for it to place a 1 in there, otherwise, nothing. I've had
problems trying to create the if statement, but have had no sucess in doing
it...can someone help me.

Thank you
 
S

SIR Knight

metaltecks,

You should be able to structure your function as follows

=if((B1-A1)>30,1,"")

Where B1 & A1 are your current columns

Steve
 
B

Bernard Liengme

You do not state which is always the larger. I will assume second column (B)
=IF(B2-A2>=30, 1, "")
If either can be the greater
=IF(ABS(B2-A2)>=30, 1, "")
Sometimes (but apparently not here), Excel will automatically format a cell
for dates when it contains a formula uses dates - just format as General if
this happens
best wishes
 
O

oldchippy

metaltecks said:
I have 2 columns, ADM and DISC. These are both date fields in the format
of
6/20/2006.

In a column next to these 2 columns, I want to create a formula that
will
check the difference between the 2 dates. If the date difference
reaches 30
days, I would like for it to place a 1 in there, otherwise, nothing.
I've had
problems trying to create the if statement, but have had no sucess in
doing
it...can someone help me.

Thank you
Hi metaltechs,

Try something like this

=IF(B1-A1>=30,1,"") , if more that 30 then ">30"

Change format of C1 to number

oldchippy :)
 
Top