If Then with Today formula

J

JimG

I am trying to subtract one date from another using the Today() formula, but
if the value is greater than 250 I want to return the value of 0.

Can someone help?
 
S

Sheeloo

=IF(A1-Today()>250,A1-Today(),0)

with date in A1...

You can change the comparison according to your logic.
 
J

JimG

Perhaps I am being dense but it isn't working. Here is a sample of what I
have
A1 B1 C1
3/21/2009 Request Date Days in Processing
1/1/2008 445
3/21/09 is Today() and the result is 445. If it is under 200 I want it to
display the value, but if over 200 I need it to show zero.

I appreciate the help
 
S

Sheeloo

If 1/1/2008 is in A1 and you want the result in B1 then enter this in B1
=IF((Today()-A1)<200,Today()-A1,0)

I had left out the () around the condition..
 
J

Joel

Does this work?

=IF(A1-B2>250,A1-B2,0)

Make sure the cell address are right. Sheelo used Today. I simply replaced
Today with the cell B2.
 
T

T. Valko

If it is under 200 I want it to display the value,
but if over 200 I need it to show zero.

What if the difference *is* 200?

Try this:

A1 = today

=(B1-A1)*(B1-A1<200)
 
S

Shane Devenshire

Based on the OP's data layout, they can use either

=(A1-B1<200)*(A1-B1)
or
=IF(A1-B1>200,0,A1-B1)

but if you really want to be cute then in C1 enter
=A1-B1
and then apply the following custom format to C1
[>200]"0"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top