Multiple conditional formula

  • Thread starter LeslieO via OfficeKB.com
  • Start date
L

LeslieO via OfficeKB.com

Hi, I'm stuck on a formula I'm trying to add to my spreadsheet. Essentially,
I need the formula to do the following:
In the formula cell (D1),
If A1 is >0, then I need the answer to be :
$40.00 if B1 says X
$30.00 if B1 says Y
$30.00 if B1 says Z

and so on.

I tried the following and it's not working because I can't figure out how to
get the formula to check A1 for a value before it runs the IF test. I've
edited the last bit of the formula (etc.). I have additional if tests, not
etc. What do I need to add to this or should I scrap it and try a straight
Lookup? All help is greatly appreciated!

=IF(B1="X",40,IF(B1="Y",30,IF(B1="Z",etc.)))))
 
L

LeslieO via OfficeKB.com

I feel lame. Didn't take much to fix this. Just in case someone else is
looking for this kind of information the formula is below:

=IF(A1=0,0,IF(B1="X",40,IF(B1="Y",30,IF(B1="Z",30,IF(B1="etc",3,IF(B1="etc",
40,""))))))

This formula will check one cell (A1) for a value more than 0, then goes to
another cell to check for particular values (X,Y,Z) and returns the
appropriate value. This reminds me of a LOOKUP function. There's probably a
more elegant solution that I'm not thinking of.
 
T

T. Valko

and so on.

How many "and so on's" are there?
$40.00 if B1 says X
$30.00 if B1 says Y
$30.00 if B1 says Z

Are the repeat 30's correct?

=IF(A1>0,IF(B1="X",40,IF(OR(B1="Y",B1="Z"),30,"")),"")

Biff
 

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