ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Multiple conditions and IF Statements (https://www.excelbanter.com/excel-discussion-misc-queries/173593-multiple-conditions-if-statements.html)

[email protected]

Multiple conditions and IF Statements
 
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'!
B310,"Yellow","Green")

Thanks!

Pete_UK

Multiple conditions and IF Statements
 
Try it this way:

=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B330,"Red",IF('Small Business Card Data'!C3-'Small Business Card
Data'!B310,"Yellow","Green"))

Hope this helps.

Pete

On Jan 18, 3:54*pm, wrote:
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'!
B310,"Yellow","Green")

Thanks!



HKaplan

Multiple conditions and IF Statements
 
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.

[email protected]

Multiple conditions and IF Statements
 
On 18 Jan, 11:44, Pete_UK wrote:
Try it this way:

=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B330,"Red",IF('Small Business Card Data'!C3-'Small Business Card
Data'!B310,"Yellow","Green"))

Hope this helps.

Pete

On Jan 18, 3:54*pm, wrote:



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'!
B310,"Yellow","Green")


Thanks!- Hide quoted text -


- Show quoted text -


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

Pete_UK

Multiple conditions and IF Statements
 
You're welcome - thanks for feeding back.

Pete

On Jan 18, 4:55*pm, wrote:
On 18 Jan, 11:44, Pete_UK wrote:





Try it this way:


=IF('Small Business Card Data'!C3-'Small Business Card Data'!
B330,"Red",IF('Small Business Card Data'!C3-'Small Business Card
Data'!B310,"Yellow","Green"))


Hope this helps.


Pete


On Jan 18, 3:54*pm, wrote:


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'!
B310,"Yellow","Green")


Thanks!- Hide quoted text -


- Show quoted text -


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

- Show quoted text -




All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com