Forum Discussion
Service time
If you want to calculate the total service time considering both periods (original start to original leave date and 2nd start date to 2nd leave date), you can adjust the formula accordingly. Assuming AA22 is the original start date, AB22 is the original leave date, AC22 is the 2nd start date, and AD22 is the 2nd leave date, you can use the following formula:
=TEXTJOIN(", ", TRUE,
DATEDIF(AA22, AB22, "Y") & " YEARS",
DATEDIF(AA22, AB22, "YM") & " MONTHS",
DATEDIF(AA22, AB22, "MD") & " DAYS",
DATEDIF(AC22, AD22, "Y") & " YEARS",
DATEDIF(AC22, AD22, "YM") & " MONTHS",
DATEDIF(AC22, AD22, "MD") & " DAYS"
)
This formula calculates the service time for the original period (AA22 to AB22) and the service time for the 2nd period (AC22 to AD22) and then combines them into a single string with commas and spaces using the TEXTJOIN function.
Make sure to adjust the cell references based on your actual data in your worksheet.