How much long service bonus to pay? [Homework]
‘Tis Friday and it is too hot in my home office to stand and type a longish post. So, let’s keep this skirtish (short and pretty).
How would you calculate long service bonus?
Let’s say you are HR manager at BigLargeInc. and you are looking at Julia’s service details. You have her employment start date, current date, her leave without pay details, as shown below.
You need to calculate how many days of continuous service Julia has (ie total service – duration on leave without pay). How would you write the formula?
Assume cell references as shown in the picture above.
Please post your answers in comments.
Bonus question? Think Julia’s troubles are nothing? Then come up with formulas to tell how many years and months of long service Julia had. Assume each year has 365.25 days and 12 months in it.
Answers for the example above:
For the above data, you should get below answers
 Continuous service days: 4,870
 Continuous service in years and months: 13 years and 4 months
Go ahead and post your formulas in comments. Julia is waiting for her bonus.
 

Leave a Reply
5 conditional formatting top tips – Excel basics  Merry Christmas and Happy New Year 2018 [Holiday Card] 
21 Responses to “How much long service bonus to pay? [Homework]”
Days:
=(C4C3)(C8C7)
Years and Months
=INT(((C4C3)(C8C7))/365.25) & " Years " & ((MOD(((C4C3)(C8C7)),365.25)/365.25)*12) & " Months"
In C10, Days = "=DATEDIF(C2,C3,"d")DATEDIF(C6,C7,"d")"
In C11, Years = "=TRUNC(C10/365.25)"
In C12, Months = "=TRUNC(MOD(C10,365.25)/(365.25/12))"
Just noticed that I set my sheet up slightly differently to the post. C10 should read "=DATEDIF(C3,C4,"d")DATEDIF(C7,C8,"d")"
@FirstTimePoster,
To my opinion  the Months calculation part can be shorten to:
=(MOD(((C4C3)(C8C7))/365.25,1)*12)
Micky
FirstTimePoster: 13 years and 4 months
Michael: 13 years and 4.00000000000001 months
and with some arithmetic manipulation:
=MOD((C4C3C8+C7)/365.25,1)*12
Micky
I think this function works well.
=DATEDIF(B1,B2,"d")DATEDIF(B4,B5,"d")
=DATEDIF(C2,C3,"d")DATEDIF(C7,C8,"d")
or =C7C2+C3C8
or =ROWS(INDIRECT(C2&":"&C3,TRUE))ROWS(INDIRECT(C7&":"&C8,TRUE))
=DATEDIF(C2,C3,"y")DATEDIF(C7,C8,"y")& " years and "&DATEDIF(C2,C3,"ym")DATEDIF(C7,C8,"ym")&" months"
or
=INT(YEARFRAC(C2,C3,1)YEARFRAC(C7,C8,1))&" Years and "&ROUND(MOD(YEARFRAC(C2,C3,1)YEARFRAC(C7,C8,1),1)*12,0)&" Months"
B12=C4C3(C8C7)
B13=DATEDIF(1,B12,"Y") & " years and " & DATEDIF(1,B12,"YM") & " months"
To acquire the service days in B12 I used [ =DAYS(C4,C3)DAYS(C8,C7) ]
Then to convert the answer in B12 into years, months and days I used 
[ =DATEDIF(0,B12,"y")&" years "&DATEDIF(0,B12,"ym")&" months "&DATEDIF(0,B12,"md")&" days" ]
Continuous Service Days
=((C4C3)(C8C7))
Continous Service Year & Month
=DATEDIF(C3,C4,"Y")DATEDIF(C7,C8,"Y")&" Years "&TEXT(MOD(((C4C3)(C8C7))/365.25,1)*12,"#")&" Months"
pl rephrase the questionas "total service – duration on leave without pay" should not be called continuos serviceas I understand she worked continuosly for 1157 days and ,after unpaid leave, for 3713 dayspl clarify what is required
Continuous Days: =(C4C3)(C8C7)
I agree with Anil above..."continuous days" means something different than the definition given. That, and I distrust most HR departments. 🙂
In Years and Months: This will be a break from the DATEDIF function I see above. Nothing wrong with DATEDIF, I just did things differently:
=QUOTIENT(B12,365.25)&" years and ""IENT(MOD(B12,365.25),365.25/12)&" months"
Days: =C7C3+C4C8 (result in cell G8)
Years and months: =ROUNDDOWN(G8/365,25;0)&" years and "&ROUND((G8/365,25G9)*12;0)&" months"
Result: 13 years and 4 months
Simple pattern for plus and minus and datedif for year and month
=A4A3(A8A7) =>4870
=DATEDIF(1,(A4A3(A8A7)),"Y")&" Years "&DATEDIF(1,(A4A3(A8A7)),"YM")&" Months" =>13 Years 4 Months
Thanks, I will bookmark it and try it when I get back 😉
I would first calculate the Julias's days of service (ServiceDays) as
= (CurrentDate  EmploymentStart + 1)  (LeaveEnd  LeaveStart + 1)
Complete years service would be
= FLOOR( ServiceDays, DaysPerYear ) / DaysPerYear
with a balance of days (AdditionalDays)
= MOD( ServiceDays, DaysPerYear )
To avoid clutter that could be a Named formula.
The additional days equate to completed months
= FLOOR( AdditionalDays, DaysPerMonth ) / DaysPerMonth
where DaysPerMonth is given by
= DaysPerYear / MonthsPerYear
=DAYS(C4,C3)DAYS(C8,C7)&" Days"
Both (Continuous service days) & (Continuous service in years and months) can be found out by using a single formula DATEDIF
=DATEDIF("1104","81217","d")DATEDIF("3307","91007","d") will give 4,870
=DATEDIF("1104","81217","y")DATEDIF("3307","91007","y") will give 13
=DATEDIF("1104","81217","ym")DATEDIF("3307","91007","ym") will give 4
=DATEDIF(B1,B2,"y")DATEDIF(D2,D3,"y")&"years,"&DATEDIF(B1,B2,"Ym")DATEDIF(D2,D3,"Ym")&"Months"
for days: =DATEDIF(B1,B2,"d")DATEDIF(D2,D3,"d")