Length of Service - Flag 5, 10, 15 years etc over 12 months

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
451
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I am trying to creating a workbook that will show me over the next 12 months, if an employee hits 5, 10, 15, 20, 25 or 30+ years of service.

Something like the below format would be great.

For example, I can see if May 22 Chris will hit 5 years, In June Rhys will hit 10 years, in Sept Steve will hit 15 years and so on. Is this possible?

It doesn't necessarily have to be in the below format, I just need it to be in a table so I can pull it into Power BI.

Many Thanks

NameStart DateLength of ServiceMay-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-22Jan-23Feb-23Mar-23Apr-23May-23
Dave
04/10/2012​
910
Jim
19/09/2021​
0
Steve
20/09/2006​
1515
Chris
21/05/2017​
45
Em
13/08/2000​
21
Ian
06/11/1996​
2525
Tom
06/07/2021​
0
Rhys
02/06/2012​
910
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Looks like Steve would actually have hit 15 years in Sep 21, not Sep 22.
Similarly with Ian, hitting 25 years in Nov 21, not Nov 22.
Or is it more complicated than that ?
 
Upvote 0
I changed some of the start date years for reasons.

Cell Formulas
RangeFormula
D1D1=EOMONTH(TODAY(),-1)+1
E1:P1E1=EOMONTH(D1,0)+1
C2:C9C2=(TODAY()-B2)/365.25
D2:P9D2=IF(AND(MONTH(D$1)=MONTH($B2),MOD(YEAR(D$1)-YEAR($B2),5)=0),YEAR(D$1)-YEAR($B2),"")
 
Upvote 0
I changed some of the start date years for reasons.

Cell Formulas
RangeFormula
D1D1=EOMONTH(TODAY(),-1)+1
E1:P1E1=EOMONTH(D1,0)+1
C2:C9C2=(TODAY()-B2)/365.25
D2:P9D2=IF(AND(MONTH(D$1)=MONTH($B2),MOD(YEAR(D$1)-YEAR($B2),5)=0),YEAR(D$1)-YEAR($B2),"")

This is amazing thank you so much. If needed, is it possible to select random years rather than a multiple of 5? For example, 5, 10, 12, 15, 18, 21, 22, 25
Many thanks
 
Upvote 0
I don't have excel handy now....
The part where I have MOD(year-year),5)=0 does the 5 year thing. I use MOD a lot.
You might make it OR(year-year={5,10,12,15,18,21,22,25}). I'll have to try that later.
 
Upvote 0
Cell Formulas
RangeFormula
D1D1=EOMONTH(TODAY(),-1)+1
E1:P1E1=EOMONTH(D1,0)+1
C2:C9C2=(TODAY()-B2)/365.25
D2:P9D2=IF(AND(MONTH(D$1)=MONTH($B2),OR(YEAR(D$1)-YEAR($B2)={5,10,12,15,18,21,22,25})),YEAR(D$1)-YEAR($B2),"")
 
Upvote 0
Solution
Cell Formulas
RangeFormula
D1D1=EOMONTH(TODAY(),-1)+1
E1:P1E1=EOMONTH(D1,0)+1
C2:C9C2=(TODAY()-B2)/365.25
D2:P9D2=IF(AND(MONTH(D$1)=MONTH($B2),OR(YEAR(D$1)-YEAR($B2)={5,10,12,15,18,21,22,25})),YEAR(D$1)-YEAR($B2),"")
This is amazing thank you so much for your help
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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