Slicer for age groups

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi
I have a table like the one below. I inserted a table then I inserted Slicer for age. So I can use the slicer to filter. My question, can I group age into group like this

18-30
31-50
51-65

So the slicer can show only 3 groups only. I know that can be done in Pivot table but can it be done here with a regular table not pivot? Thank you very much

[TABLE="class: grid, width: 312"]
<colgroup><col span="3"><col></colgroup><tbody>[TR]
[TD="align: left"]name[/TD]
[TD="align: left"]sex[/TD]
[TD="align: left"]age[/TD]
[TD="align: left"]dept[/TD]
[/TR]
[TR]
[TD="align: left"]mary1[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]39[/TD]
[TD="align: left"]hr[/TD]
[/TR]
[TR]
[TD="align: left"]linda1[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]26[/TD]
[TD="align: left"]it[/TD]
[/TR]
[TR]
[TD="align: left"]kim1[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]19[/TD]
[TD="align: left"]sales[/TD]
[/TR]
[TR]
[TD="align: left"]allen1[/TD]
[TD="align: left"]m[/TD]
[TD="align: right"]38[/TD]
[TD="align: left"]it[/TD]
[/TR]
[TR]
[TD="align: left"]adam1[/TD]
[TD="align: left"]m[/TD]
[TD="align: right"]49[/TD]
[TD="align: left"]marketing[/TD]
[/TR]
[TR]
[TD="align: left"]mary2[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]50[/TD]
[TD="align: left"]sales[/TD]
[/TR]
[TR]
[TD="align: left"]linda2[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]61[/TD]
[TD="align: left"]marketing[/TD]
[/TR]
[TR]
[TD="align: left"]kim2[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]26[/TD]
[TD="align: left"]hr[/TD]
[/TR]
[TR]
[TD="align: left"]allen2[/TD]
[TD="align: left"]m[/TD]
[TD="align: right"]26[/TD]
[TD="align: left"]it[/TD]
[/TR]
[TR]
[TD="align: left"]adam2[/TD]
[TD="align: left"]m[/TD]
[TD="align: right"]27[/TD]
[TD="align: left"]sales[/TD]
[/TR]
[TR]
[TD="align: left"]mary3[/TD]
[TD="align: left"]f[/TD]
[TD="align: right"]59[/TD]
[TD="align: left"]it[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You'll need to turn it into a table if you haven't already (click in the data and press ctrl + T).

Then add a column =IF([@age]<31,"18-30",IF([@age]<51,"31-50","51-65"))

You can then slice that
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
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