Multiple conditions and IF Statements

J

jesoldano

Hello--I am trying to write an IF statement with more than 2
conditions. Ultimately, I would like to have a formula that
calculates the following:

IF #1 -- #2 is > 10, return "Yellow," Otherwise, return "Green." AND/
OR If #1 -- #2 > 30, Red, Otherwise return yellow or green (based on
thresholds above). Is this possible?

This is what I have so far:
=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B3>10,"Yellow","Green")

Thanks!
 
P

Pete_UK

Try it this way:

=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B3>30,"Red",IF('Small Business Card Data'!C3-'Small Business Card
Data'!B3>10,"Yellow","Green"))

Hope this helps.

Pete
 
H

HKaplan

If you need more than a few nested if statements, I like to use
vlookup. The lookup table might look like this (hide it anywhere in
the workbook):

No. Color
1 Red
2 Red
3 Red
4 Red
5 Yellow
6 Yellow
7 Yellow
8 Yellow
9 Green
10 Green

Then your formula (in A2 for instance) could look something like this:
=vlookup(A1,mycolortable,2,false). If the number in A1 = 10, then the
formula returns "green". If the number is 4, then it returns "Red".
This method is far easier to write and debug if you have 3 or more
nested if statements.
 
J

jesoldano

Try it this way:

=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B3>30,"Red",IF('Small Business Card Data'!C3-'Small Business Card
Data'!B3>10,"Yellow","Green"))

Hope this helps.

Pete






- Show quoted text -

This is exactly what I was looking for--thanks so much for your help.
 
P

Pete_UK

You're welcome - thanks for feeding back.

Pete

This is exactly what I was looking for--thanks so much for your help.- Hide quoted text -

- Show quoted text -
 

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