Formula in Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need this formula to be placed in my worksheet:
=IF(E25="W",-F25)+G24+B25-C25
But here is the catch: I need to be able to also type in a C into E25 and
have the same result. Along with this formula I need to be able to type in
"R" or "TX" into E25 and have it add F25 instead of substract.

This formula below is how I need it to function; if it is at all possible:
IF E25 = "W" or "C", -F25 +G24+B25-C25
IF E25 = "R" or "TX", +F25 +G24+B25-C25

is it possible to have this as one formula?
 
Craig said:
I need this formula to be placed in my worksheet:
=IF(E25="W",-F25)+G24+B25-C25

First, it is unwise to have an IF() function with only
a true (or only a false) value. Fill in something for
"..." in the following: IF(E25 = "W", -F25, ...).
But here is the catch: I need to be able to also
type in a C into E25 and have the same result.

Try IF(OR(E25 = "W", E25 = "C"), -F25, ...)
Along with this formula I need to be able to type
in "R" or "TX" into E25 and have it add F25 instead
of substract.

Try one of the following, whichever makes more
sense based on your requirements:

IF(OR(E25 = "W", E25 = "C"), -F25,
IF(OR(E25 = "R", E25 = "TX"), F25, ...))

....OR...

IF(OR(E25 = "W", E25 = "C"), -F25, F25)

The latter assumes that F25 is the correct
answer for "..." in all of the above examples.
 
I think you want

=IF(OR(E25="W",E25="C"),-F25,IF(OR(E25="R",E25="TX"),F25,0))+G24+B25-C25



--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
Back
Top