IF and how to use it

  • Thread starter Thread starter Dark Horse
  • Start date Start date
D

Dark Horse

In a spreadsheet I have columns that perform different parts of a
calculation, these are all brought together in one final formula.

However, it is possible for one column to return negative values - but I
want to ignore these and only use any positive values that are returned.
IF 'T2'<0 seems to make sense as a beginning, where T2 is the first cell
containing a value.
But where do I go from there, what makes a viable ending?
TIA
Dave
 
Dave

The IF function has three parts, seperated by commas...

=IF(Comparison, What to do if true, what to do if false)

Your formula might look like this

=IF(T2<0,"",Do your formula here)

This will leave the cell blank if the value is below 0. (Negative)

You can nest up to 7 IFs. so

=IF(Comparison, Value if True, IF(Comparison,Value if True, Value if False))

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
(e-mail address removed)
 
So to take it one step further,
=IF T2<0,"0",((((K2*14)+L2)-117)/Q2*R2))
would return a 0 value if T2 is less than 0 and perform the calculation only
if T2 is greater than 0?

If so, that is indeed the answer I was looking for.
Many Thanks.
 

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

Back
Top