Please help

Mrs Mc

New Member
Joined
Aug 8, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi i hope somebody can help me.

I have a data set that i want to group by age like this.

Under 5
Age 5 to 10
Age 11 to 15
Age 16 to 19
Age 20 to 25

what is the best way to do this please, I thought of an IF statement but I can't work it out, can someone please help me?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Thank you, I am joining two datasets together first so I would like to do an IF statement if possible, do you know if that would be possible please? Thanks so much for replying
 
Upvote 0
Hi, welcome to the forum! Here is one way you can try:

Cell Formulas
RangeFormula
B2:B30B2=LOOKUP(A2,{0,5,11,16,20,26},{"Under 5","5 to 10","11 to 15","16 to 19","20 to 25","26+"})
 
Upvote 0
this is amazing but the formula is a little beyond me. Is it not possible to do this with an IF statement?
 
Upvote 0
Is it not possible to do this with an IF statement?
Sure it is, it's just a lot of nesting.
Cell Formulas
RangeFormula
B2:B30B2=IF(A2<5,"Under 5",IF(A2<=10,"5 to 10",IF(A2<=15,"11 to 15",IF(A2<=19,"16 to 19",IF(A2<=25,"20 to 25","26+")))))
 
Upvote 0

Forum statistics

Threads
1,215,282
Messages
6,124,052
Members
449,139
Latest member
sramesh1024

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