Age Grouping

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,
Can anyone help me with a formula that can group age like below group?

Book2
ABCDEFGHI
1AgeAge GroupingAge Grouping
22726 to 34 years25 years or younger
33426 to 34 years26 to 34 years
44235 to 44 years35 to 44 years
52445 to 54 years
63855 years or older
746
836
953
1030
1125
1243
1354
1454
1550
1662
1742
1862
1952
2046
2138
2241
2361
2447
2545
2654
2755
2834
2951
3057
3143
3244
3361
3448
3567
3652
3740
3862
3953
4050
4135
4253
4353
4441
4559
4643
4756
4842
4963
5038
5149
5249
5354
5442
5564
5646
5752
5875
5947
6042
6149
Sheet1
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
=INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1))

you could add
=IF( A2="","",INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1)))


Cell Formulas
RangeFormula
C2:C70C2=INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1))
 
Upvote 0
=INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1))

you could add
=IF( A2="","",INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1)))


Cell Formulas
RangeFormula
C2:C70C2=INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1))
Perfect, what about if I need to update the tenure category based on hire date?

Book2
ABCDEFGHIJK
1AgeAge GroupingHire DateTenure CategoryAge GroupingTenure Category
22726 to 34 years1/6/2020025 years or youngerLess than 2 years
33426 to 34 years5/4/20202626 to 34 years2 to 5 years
44235 to 44 years4/6/20203535 to 44 years6 to 10 years
52425 years or younger4/13/20204545 to 54 years11 to 15 years
63835 to 44 years8/1/20215555 years or older16 to 20 years
74645 to 54 years8/3/2021More than 20 years
83635 to 44 years8/2/2021
95345 to 54 years9/1/2021
103026 to 34 years7/27/2021
112525 years or younger8/2/2021
124335 to 44 years9/6/2021
135445 to 54 years4/3/2017
145445 to 54 years11/13/2006
155045 to 54 years10/29/2013
166255 years or older4/3/2017
174235 to 44 years4/3/2017
186255 years or older4/3/2017
195245 to 54 years4/16/2007
204645 to 54 years9/14/2009
213835 to 44 years8/14/2007
224135 to 44 years4/25/2007
236155 years or older3/26/2007
244745 to 54 years1/4/2005
254545 to 54 years8/6/2007
265445 to 54 years3/10/2008
275555 years or older10/8/2003
283426 to 34 years7/5/2012
295145 to 54 years1/31/2005
305755 years or older8/15/2005
314335 to 44 years4/26/2010
324435 to 44 years11/4/2013
336155 years or older10/1/2003
344845 to 54 years12/13/2004
356755 years or older8/14/2000
365245 to 54 years10/31/2011
374035 to 44 years10/13/2008
386255 years or older4/16/2012
395345 to 54 years2/25/2009
405045 to 54 years1/11/2010
413535 to 44 years11/18/2013
425345 to 54 years6/21/2000
435345 to 54 years10/23/2013
444135 to 44 years11/4/2009
455955 years or older1/1/2010
464335 to 44 years2/6/2012
475655 years or older5/27/2013
484235 to 44 years9/5/2011
496355 years or older12/27/2010
503835 to 44 years3/12/2012
514945 to 54 years6/19/2006
524945 to 54 years10/29/2012
535445 to 54 years10/1/2012
544235 to 44 years2/13/2012
556455 years or older2/9/2003
564645 to 54 years10/21/2013
575245 to 54 years11/26/2012
587555 years or older4/1/2008
594745 to 54 years5/10/2011
604235 to 44 years5/29/2007
614945 to 54 years11/8/2010
Sheet1
Cell Formulas
RangeFormula
B2:B61B2=IF( A2="","",INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1)))
 
Upvote 0
you could use a helper column to calculate the years - Or direct from the date

=INDEX($K$2:$K$7,MATCH(DATEDIF(C2,TODAY(),"Y"),$J$2:$J$7,1))

datedif with the "Y" will give the complete years
 
Upvote 0
you could use a helper column to calculate the years - Or direct from the date

=INDEX($K$2:$K$7,MATCH(DATEDIF(C2,TODAY(),"Y"),$J$2:$J$7,1))

datedif with the "Y" will give the complete years

Book6
ABCDEFGHIJK
1AgeAge GroupingHire DateTenure CategoryyearsAge GroupingTenure Category
22726 to 34 years6/1/202 to 5 years025 years or younger0Less than 2 years
33426 to 34 years4/5/176 to 10 years2626 to 34 years22 to 5 years
44235 to 44 years6/4/01More than 20 years3535 to 44 years66 to 10 years
52425 years or younger4/13/23Less than 2 years4545 to 54 years1111 to 15 years
63835 to 44 years1/8/0716 to 20 years5555 years or older1616 to 20 years
74645 to 54 years3/8/1011 to 15 years21More than 20 years
83635 to 44 years2/8/97More than 20 years
95345 to 54 years1/9/212 to 5 years
103026 to 34 years 
112525 years or younger2/8/212 to 5 years
124335 to 44 years6/9/212 to 5 years
135445 to 54 years3/4/176 to 10 years
Sheet1
Cell Formulas
RangeFormula
B2:B13B2=IF( A2="","",INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1)))
E2:E13E2=IF(C2="","",INDEX($K$2:$K$7,MATCH(DATEDIF(C2,TODAY(),"Y"),$J$2:$J$7,1)))
 
Upvote 0
Solution
you could use a helper column to calculate the years - Or direct from the date

=INDEX($K$2:$K$7,MATCH(DATEDIF(C2,TODAY(),"Y"),$J$2:$J$7,1))

datedif with the "Y" will give the complete years

Book6
ABCDEFGHIJK
1AgeAge GroupingHire DateTenure CategoryyearsAge GroupingTenure Category
22726 to 34 years6/1/202 to 5 years025 years or younger0Less than 2 years
33426 to 34 years4/5/176 to 10 years2626 to 34 years22 to 5 years
44235 to 44 years6/4/01More than 20 years3535 to 44 years66 to 10 years
52425 years or younger4/13/23Less than 2 years4545 to 54 years1111 to 15 years
63835 to 44 years1/8/0716 to 20 years5555 years or older1616 to 20 years
74645 to 54 years3/8/1011 to 15 years21More than 20 years
83635 to 44 years2/8/97More than 20 years
95345 to 54 years1/9/212 to 5 years
103026 to 34 years 
112525 years or younger2/8/212 to 5 years
124335 to 44 years6/9/212 to 5 years
135445 to 54 years3/4/176 to 10 years
Sheet1
Cell Formulas
RangeFormula
B2:B13B2=IF( A2="","",INDEX($I$2:$I$6,MATCH(A2,$H$2:$H$6,1)))
E2:E13E2=IF(C2="","",INDEX($K$2:$K$7,MATCH(DATEDIF(C2,TODAY(),"Y"),$J$2:$J$7,1)))
THANK YOU SOOO MUCH @etaf , I was using months instead of years, this worked perfectly great.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,171
Members
452,615
Latest member
bogeys2birdies

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