Nested IF Statement

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498
I've been looking for this on the message board but no luck. Any help would be GREATLY appreciated... I am trying to write a statement that will give me a result based on the value in cell I2.
For instance, if cell I2 was 4 - result PH; but if cell I2 was 9 - result is EH.

IF(I2>=0, I2<=6,"PH", IF(I2>7, I2<=10, "EH"))

hope this makes sense.
Thanks
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try

=IF(AND(I2>=0, I2<=6),"PH", IF(AND(I2>7, I2<=10), "EH"))
 

texasalynn

Well-known Member
Joined
May 19, 2002
Messages
8,458
You would want to put the formula in that cell
=IF(and(I2>=0, I2<=6),"PH", IF(and(I2>7, I2<=10), "EH",""))

edit: should that be >=7 not >7
 
Last edited:

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Maybe:

=LOOKUP(I2,{0,"PH";7,"EH";11,""})
 

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498

ADVERTISEMENT

Question,
If I2 is a formula, this doesn't seem to work? Any suggestions?
 

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498

ADVERTISEMENT

I am using: =IF(AND(I2>=0, I2<=6),"PH", IF(AND(I2>7, I2<=10), "EH")) , it returns FALSE.

....I2 Contains the formula: =Right(H2,2)
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
The RIGHT function returns a Text string. Change your formula to
Code:
=RIGHT(H2,2)*1
lenze
 

toleafs

Active Member
Joined
Jun 27, 2005
Messages
498
I ran into another issue....I have 7 conditions to meet and excel does not allow me to nest 7 IF statements. Any ideas?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,838
Messages
5,598,383
Members
414,234
Latest member
grlevesq

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top