adding two dates which are in text format (3 years 2 months 13 days) + (3 years 4 months 29 days)

myletterboxnp

New Member
Joined
May 20, 2022
Messages
32
Office Version
  1. 365
Column F1 has Hire dates (01/09/2017)
Column G1 has re-hire dates (07/27/2020)
Column H1 has calculated length_of_service_Since_Hire (3 years 2 months 13 days) (text field)
Column I1 has calculated length_of_Service_Since_Re_hire (3 years 4 months 29 days) (text filed)

in Column I1, what formula can calculate the seniority date meaning : (Length_of_Service_Since_Hire+Length_of_Service_Since_Re_Hire)?

Some people don't have re_Hire_date.

Thank you!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Column I1 has calculated length_of_Service_Since_Re_hire (3 years 4 months 29 days) (text filed)

in Column I1, what formula can calculate the seniority date meaning : (Length_of_Service_Since_Hire+Length_of_Service_Since_Re_Hire)?
You have given same cell address in both scenarios above? Please explain

Do you want i1 to give higher of the two period? or

you want i1 to give values as they are and want to merge two information in some other cell address?
 
Upvote 0
I am sure someone can come up with a simpler solution than this, but in the meantime try this is J1.
I have assumed 31 days in a month to convert days to months.

Excel Formula:
=LET(arr,TEXTSPLIT(TEXTJOIN(";",TRUE,H1,I1)," ",";"),
origdays,SUM(--INDEX(arr,0,5)),
origmths,SUM(--INDEX(arr,0,3)) + INT(origdays/31),
fyrs,SUM(--INDEX(arr,0,1))+ INT(origmths/12),
fdays, MOD(origdays,31),
fmths,MOD(origmths,12),
fyrs & " years " & fmths & " months " & fdays & " days  ")
 
Upvote 0
Another option:

Senority dates.xlsx
FGHIJK
109/01/201727/07/20203 years 2 months 13 days3 years 4 months 29 days6 years 7 months 10 days
Hoja1
Cell Formulas
RangeFormula
K1K1=LET( a,TEXTSPLIT(H1," "),y_1,CHOOSECOLS(a,1),m_1,CHOOSECOLS(a,3),d_1,CHOOSECOLS(a,5), b,TEXTSPLIT(I1," "),y_2,CHOOSECOLS(b,1),m_2,CHOOSECOLS(b,3),d_2,CHOOSECOLS(b,5), t,(EDATE(F1,12*y_1+m_1)+d_1-F1) + IF(G1<>"",EDATE(G1,12*y_2+m_2)+d_2 - G1,0), y,INT(t/365.25), m,INT((t-y*365.25)/30.4375), d,INT(t-y*365.25-m*30.4375), y & " years " & m & " months " & d & " days" )


365.25 are the average days per year in a century (from 2000 to 2100).
30.4375 are the average days per month in a century.
 
Upvote 0
Sorry ignore the previous post. The formula has some errors in it calculation.

Here is another one that I think work ok:

Senority dates.xlsx
FGHIJK
109/01/201727/07/20203 years 2 months 13 days3 years 4 months 29 days6 years 7 months 11 days
Hoja1
Cell Formulas
RangeFormula
K1K1=LET( a,TEXTSPLIT(H1," "),y_1,CHOOSECOLS(a,1),m_1,CHOOSECOLS(a,3),d_1,CHOOSECOLS(a,5), b,TEXTSPLIT(I1," "),y_2,IFERROR(CHOOSECOLS(b,1),0),m_2,IFERROR(CHOOSECOLS(b,3),0),d_2,IFERROR(CHOOSECOLS(b,5),0), y, y_1+y_2+INT((m_1+m_2+INT((d_1+d_2)/30.4375))/12), m,MOD(m_1+m_2+INT((d_1+d_2)/30.4375),12), d,INT(MOD(d_1+d_2,30.4375)), t,y & " years " & m & " months " & d & " days", t)
 
Upvote 0
What result do you require? Total days? Total years? Total months?

T202312a.xlsm
FGHIJ
1
209-Jan-1727-Jul-203 years 2 months 13 days3 years 4 months 29 days6.45
9a
Cell Formulas
RangeFormula
J2J2=(DATE(INDEX(TEXTSPLIT(H2," ",,1),1),INDEX(TEXTSPLIT(H2," ",,1),3),INDEX(TEXTSPLIT(H2," ",,1),5))+DATE(INDEX(TEXTSPLIT(I2," ",,1),1),INDEX(TEXTSPLIT(I2," ",,1),3),INDEX(TEXTSPLIT(I2," ",,1),5)))/365
 
Upvote 0
Solution
Ignore my post above except for the line "What result do you require".
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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