Formula to calculate tenure (Years & Months)

janema

Board Regular
Joined
Nov 28, 2022
Messages
143
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2011
  5. 2010
Platform
  1. Windows
  2. Mobile
=DATEDIF(G2,NOW(),”Y”)& ”years", “&DATEDIF(G2,TODAY(),”YM”)& ”months“

I am using the above formula to calculate the tenure date in years and months for people, but it keeps coming back as #NAME? error. G2 in above formula is the date a person started at the organization. I am trying to just calculate between that date and today/current without having to use two separate dates, if that's possible. I tried the "NOW" and "TODAY" but both return that #NAME? error. Any idea what I'm doing wrong here? :(
 
Try if this works:
Excel Formula:
=DATEDIF(G2,TODAY(),"y")&" Years "&DATEDIF(G2,TODAY(),"ym")&" Months"
 
Upvote 0

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Last one. Promise.
Excel Formula:
=IF(MONTH(TODAY())>MONTH(G2),YEAR(TODAY())-YEAR(G2),YEAR(TODAY())-(YEAR(G2))-1)&" Years "&MONTH(TODAY())&"Months"

Thanks so much for your help! For some reason, I keep getting an error on them. I ended up putting the date and locking that and it worked using "two" dates.
 
Upvote 0
Assuming you want completed months I don't believe that (post # 10) version of the formula will give you a correct result.
What happened when you tried @snjpverma's post # 11 version ?

PS: I seem to be in the minority but I am not a fan of putting Today or Now directly into a formula.
a) it is a volatile function and constantly recalculating
b) is is being used in the formula like you would a constant and which lends it to being put into a cell like a parameter.
This makes testing easier since you only have one place you to change it and helps rerun a report when you discover you need to run the report retropectively because you missed running one.

20230222 DateDif Years and Months janema.xlsx
ABCDEFG
1DateDifPost #10Hire Date
22 Years 0 Months2 Years 2Months24/01/2021
3
4
5
6Current Date --->22/02/2023
7
8DateDifPost #10Hire Date
92 Years 0 Months2 Years 2Months24/01/2021
Data
Cell Formulas
RangeFormula
A2A2=DATEDIF(G2,TODAY(),"y")&" Years "&DATEDIF(G2,TODAY(),"ym")&" Months"
B2B2=IF(MONTH(TODAY())>MONTH(G2),YEAR(TODAY())-YEAR(G2),YEAR(TODAY())-(YEAR(G2))-1)&" Years "&MONTH(TODAY())&"Months"
B6B6=TODAY()
A9A9=DATEDIF(G9,$B$6,"y")&" Years "&DATEDIF(G9,$B$6,"ym")&" Months"
B9B9=IF(MONTH($B$6)>MONTH(G9),YEAR($B$6)-YEAR(G9),YEAR($B$6)-(YEAR(G9))-1)&" Years "&MONTH($B$6)&"Months"
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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