Nested IF formula

MWaller

New Member
Joined
Mar 22, 2018
Messages
6
Please can someone help me with a nested if formula. Understand the concept just cannot get it to work. I’m wanting to band a set of data into categories as follows:
Less than 20 = small
20 - 59 = medium
60 - 99 = large
100 plus = extra large

If someone could post me the foruano for this I would be sooooo grateful. Assuming my data starts in b2

Thank you in advance.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try this:

Code:
=if(b2<20,"small",if(and(b2>=20,b2<=59),"medium",if(and(b2>=60,b2<=99),"large","extra large")
 
Upvote 0
Sorry missed a parenthesis, try this version:

Code:
=IF(B2<20,"small",IF(AND(B2>=20,B2<=59),"medium",IF(AND(B2>=60,B2<=99),"large","extra large")))
 
Upvote 0
MWaller, Good afternoon.

Try to use this as you requested:
Code:
=IF(B2>=100,"Extra Large",IF(B2>=60,"Large",IF(B2>=20,"Medium","Small")))

This is not the most efficient method for your case.

Try using the VLOOKUP or LOOKUP

Hope this helps.
 
Upvote 0
Hi,

Did you try Marcilio's formula?
It's shorter and requires less functions/processing.
Here's a LOOKUP just for variety:


Book1
BCD
1Extra Large
2100
Sheet36
Cell Formulas
RangeFormula
D1=LOOKUP(B2,{0,20,60,100},{"Small","Medium","Large","Extra Large"})
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,021
Latest member
Justyna P

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