Tenure Grouping (choosing the right months range)

zinah

Active Member
Joined
Nov 28, 2018
Messages
368
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm trying to group dates under tenure grouping and some group members here helped with suggesting the formula I'm using in my below example, but I noticed the tenure category grouping has some issues as it's not choosing the right group when the months of service is greater than 5 years. Any suggestion to fix this issue and get the right category from the table below?

Book2
ABCDEFGHIJ
1DateTenure CategoryProblemTenure Category
21/30/19955-10 Yrsthis one should be more than 10 years not this category0< 2 Months
31/1/19985-10 Yrs2< 6 Months
41/11/19995-10 Yrs6< 1 Yr
51/25/19995-10 Yrs121-2 Yrs
61/14/20025-10 Yrs242-5 Yrs
71/7/20025-10 Yrs605-10 Yrs
81/27/20035-10 Yrs10000> 10 Yrs
91/28/20035-10 Yrs
101/27/20045-10 Yrs
111/1/20045-10 Yrs
121/4/20055-10 Yrs
131/31/20055-10 Yrs
141/23/20055-10 Yrs
151/3/20055-10 Yrs
161/18/20055-10 Yrs
176/26/20055-10 Yrs
181/4/20055-10 Yrs
191/31/20055-10 Yrs
201/17/20055-10 Yrs
211/5/20055-10 Yrs
221/17/20065-10 Yrs
231/23/20065-10 Yrs
241/1/20065-10 Yrs
251/9/20065-10 Yrs
261/17/20065-10 Yrs
271/2/20065-10 Yrs
281/23/20065-10 Yrs
291/17/20075-10 Yrs
301/8/20075-10 Yrs
315/27/20075-10 Yrs
321/8/20075-10 Yrs
331/2/20075-10 Yrs
341/28/20085-10 Yrs
351/21/20085-10 Yrs
361/28/20085-10 Yrs
371/2/20085-10 Yrs
381/2/20085-10 Yrs
391/11/20105-10 Yrs
401/1/20105-10 Yrs
411/4/20105-10 Yrs
421/25/20105-10 Yrs
431/25/20105-10 Yrs
441/25/20105-10 Yrs
451/4/20105-10 Yrs
461/11/20105-10 Yrs
471/4/20105-10 Yrs
481/25/20105-10 Yrs
491/18/20105-10 Yrs
501/28/20105-10 Yrs
511/18/20105-10 Yrs
528/14/20172-5 Yrs
5310/12/20172-5 Yrs
547/10/20172-5 Yrs
557/24/20172-5 Yrs
566/8/20172-5 Yrs
576/19/20172-5 Yrs
586/12/20172-5 Yrs
596/26/20172-5 Yrs
606/5/20172-5 Yrs
616/19/20172-5 Yrs
626/5/20172-5 Yrs
636/22/20172-5 Yrs
646/5/20172-5 Yrs
656/14/20172-5 Yrs
666/19/20172-5 Yrs
676/28/20172-5 Yrs
686/19/20172-5 Yrs
696/16/20172-5 Yrs
707/1/20172-5 Yrs
717/31/20172-5 Yrs
727/3/20172-5 Yrs
737/10/20172-5 Yrs
Sheet1
Cell Formulas
RangeFormula
B2:B73B2=VLOOKUP(DATEDIF(A2,TODAY(),"M"),$I$2:$J$8,2,1)
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
why 10000 for >10years
10years x 12 months = 120

change >10yrs to 120
NOT 10000

i had to change the dates as a few came over as text

Book2
ABCDEFGHIJK
1DateTenure CategoryProblemTenure Category
21/30/95> 10 Yrsthis one should be more than 10 years not this category3281200< 2 Months
33/30/93> 10 Yrs2< 6 Months
46/30/94> 10 Yrs6< 1 Yr
59/30/95> 10 Yrs121-2 Yrs
612/30/96> 10 Yrs242-5 Yrs
73/30/98> 10 Yrs605-10 Yrs
86/30/99> 10 Yrs120> 10 Yrs
99/30/00> 10 Yrs
1012/30/01> 10 Yrs
113/30/03> 10 Yrs
126/30/04> 10 Yrs
139/30/05> 10 Yrs
1412/30/06> 10 Yrs
153/30/08> 10 Yrs
166/30/09> 10 Yrs
179/30/10> 10 Yrs
1812/30/11> 10 Yrs
193/30/135-10 Yrs
206/30/145-10 Yrs
219/30/155-10 Yrs
2212/30/165-10 Yrs
233/30/182-5 Yrs
246/30/192-5 Yrs
259/30/201-2 Yrs
2612/30/21< 6 Months
271/2/22< 6 Months
282/3/22< 6 Months
293/7/22< 6 Months
304/8/22< 2 Months
315/10/22< 2 Months
Sheet3
Cell Formulas
RangeFormula
D2D2=DATEDIF(A2,TODAY(),"M")
F2F2=12*10
B2:B31B2=VLOOKUP(DATEDIF(A2,TODAY(),"M"),$I$2:$J$8,2,1)
 
Upvote 0
Solution
why 10000 for >10years
10years x 12 months = 120

change >10yrs to 120
NOT 10000

i had to change the dates as a few came over as text

Book2
ABCDEFGHIJK
1DateTenure CategoryProblemTenure Category
21/30/95> 10 Yrsthis one should be more than 10 years not this category3281200< 2 Months
33/30/93> 10 Yrs2< 6 Months
46/30/94> 10 Yrs6< 1 Yr
59/30/95> 10 Yrs121-2 Yrs
612/30/96> 10 Yrs242-5 Yrs
73/30/98> 10 Yrs605-10 Yrs
86/30/99> 10 Yrs120> 10 Yrs
99/30/00> 10 Yrs
1012/30/01> 10 Yrs
113/30/03> 10 Yrs
126/30/04> 10 Yrs
139/30/05> 10 Yrs
1412/30/06> 10 Yrs
153/30/08> 10 Yrs
166/30/09> 10 Yrs
179/30/10> 10 Yrs
1812/30/11> 10 Yrs
193/30/135-10 Yrs
206/30/145-10 Yrs
219/30/155-10 Yrs
2212/30/165-10 Yrs
233/30/182-5 Yrs
246/30/192-5 Yrs
259/30/201-2 Yrs
2612/30/21< 6 Months
271/2/22< 6 Months
282/3/22< 6 Months
293/7/22< 6 Months
304/8/22< 2 Months
315/10/22< 2 Months
Sheet3
Cell Formulas
RangeFormula
D2D2=DATEDIF(A2,TODAY(),"M")
F2F2=12*10
B2:B31B2=VLOOKUP(DATEDIF(A2,TODAY(),"M"),$I$2:$J$8,2,1)
Thank you so much, that worked perfectly great!
 
Upvote 0

Forum statistics

Threads
1,223,244
Messages
6,170,976
Members
452,372
Latest member
Natalie18

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