IF Function - more advanced

jma2fish

New Member
Joined
Aug 23, 2011
Messages
2
I have read the other threads...I can get 75% of the "IF Function" below to work but when I add the 2nd portion of:IF(AND((B13)>250,(B13)<=350,2,2.5))), statement I then get an error.

=IF((B13)<=150,1,IF(AND((B13)>150,(B13)<=250),1.5,IF(AND((B13)>250,(B13)<=350,2,2.5)))


Cell B13 can be any number between 0-500 and is an AutoSUM cell from 2 other cells.

GOAL:
IF B13 <=150, return 1
IF B13 >150 but <=250, return 1.5
IF B13 >250 but <=350, return 2
IF B13 >351, return 2.5
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
The OP's is missing a closing parenthesis in the second AND statement. Try:

=IF((B13)<=150,1,IF(AND((B13)>150,(B13)<=250),1.5,IF(AND((B13)>250,(B13)<=350),2,2.5)))
 
Upvote 0
Wow, this feedback was fantastic. I really appreciate everyone's response. I did in fact try all 3 recommendations and all worked as planned.

I appreciate all the expertise. Thank you.

Regards from Asheville, North Carolina!
 
Upvote 0
Actually, you don't need the AND conditions. Since the formula will execute left to right, if B13 is not less than 150, it must be greater than 150, so you don't need to check that condition. Here is a shorter version of your formula, corrected for the missing paren.

=IF(B13<=150,1,IF(B13<=250,1.5,IF(B13<=350,2,2.5)))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,723
Members
452,939
Latest member
WCrawford

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
Back
Top