Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Formula to Calculate Employee Tenure

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To calculate employee tenure in Excel, subtract the hire date from today's date and convert the result to years: =YEARFRAC(hire_date, TODAY()). If you want whole years and months, use =DATEDIF(hire_date, TODAY(), "Y") for years and =DATEDIF(hire_date, TODAY(), "YM") for the remaining months. Both formulas update automatically whenever the workbook recalculates, so tenure stays current without manual edits.

What You'll Need

  • A column of hire dates entered as real Excel dates (not text).
  • A blank column for the tenure result.
  • Basic familiarity with cell references (e.g., A2).

Step-by-Step

  1. Confirm your hire dates are real dates. Select the hire date column. If the values align left by default, they may be stored as text. Use Data > Text to Columns and finish the wizard, or re-enter them in a recognized date format (e.g., 15-Jan-2020). Real dates align right by default.
  2. Pick a blank column for tenure. For example, if hire dates are in column A starting at A2, use column B starting at B2. Add a header such as “Tenure (Years)”.
  3. Enter the basic tenure formula. In B2, type =YEARFRAC(A2, TODAY()) and press Enter. This returns a decimal number of years (e.g., 3.75).
  4. Round to a sensible precision. Wrap the formula in ROUND: =ROUND(YEARFRAC(A2, TODAY()), 1) for one decimal place, or use 0 for whole years. Alternatively, use =DATEDIF(A2, TODAY(), "Y") for completed years only.
  5. Build a years-and-months display (optional). In C2, enter =DATEDIF(A2, TODAY(), "Y") & " years, " & DATEDIF(A2, TODAY(), "YM") & " months". This produces readable text like “3 years, 9 months”.
  6. Copy the formula down. Drag the fill handle from B2 (or C2) down to the last row of employees. Excel adjusts the row references automatically.
  7. Format the result. For decimal years, select the column and use Home > Number Format to set one or two decimal places. For the text version, no number formatting is needed.
  8. Handle blank or future hire dates. Wrap the formula in IFERROR or IF to avoid errors: =IF(A2="","",ROUND(YEARFRAC(A2,TODAY()),1)). For future dates, add a check: =IF(A2>TODAY(),"Not started",ROUND(YEARFRAC(A2,TODAY()),1)).
  9. Freeze the calculation date if needed. If you need tenure as of a specific date (e.g., end of payroll period), replace TODAY() with a cell reference holding that date, such as =YEARFRAC(A2, $E$1), where E1 contains the cutoff date.

Common Mistakes

  • Hire dates stored as text. Formulas like YEARFRAC and DATEDIF return #VALUE! when the date is text. Convert with Text to Columns or re-enter as dates.
  • Using 365 as a divisor. =(TODAY()-A2)/365 ignores leap years and drifts over time. YEARFRAC handles leap years correctly.
  • Forgetting to lock the cutoff date. If you reference a fixed date cell, use absolute references ($E$1) so copying the formula down does not shift the reference.
  • Mixing date systems. Excel for Windows and Excel for Mac can use different date systems (1900 vs. 1904). This is rare but causes off-by-four-years errors. Check File > Options > Advanced (Windows) or Excel > Preferences (Mac) if results look wrong.
  • Assuming DATEDIF is listed in the function wizard. It works but is not documented in the Insert Function dialog. Type it manually.

Tips

  • Use a named range for the cutoff date to make formulas easier to read.
  • For sorting or filtering by tenure, keep a numeric column (decimal years) rather than text.
  • To show tenure in months only, use =DATEDIF(A2, TODAY(), "M").
  • Combine with conditional formatting to highlight employees reaching milestone anniversaries.
  • If you need tenure as of termination, use the termination date instead of TODAY().

Troubleshooting

If you see #VALUE!, check that the hire date cell contains a real date, not text. Select the cell and look at the formula bar: a real date appears as a date, not as a left-aligned string. If it is text, convert it.

If you see #NUM! from DATEDIF, the start date is later than the end date. Ensure the hire date is not in the future relative to TODAY() or your cutoff date.

If the result is a strange number like 45000, the cell is formatted as General. Apply a number format with the desired decimal places.

If the formula returns a negative number, the hire date is in the future. Use the IF check from Step 8 to display a friendly message instead.

If copying the formula down produces the same result for every row, you likely used absolute references (e.g., $A$2) instead of relative ones (A2). Remove the dollar signs from the row reference.

Frequently Asked Questions

Can I calculate tenure in years and months without DATEDIF?

Yes. Use =INT(YEARFRAC(A2,TODAY())) for years and =INT((YEARFRAC(A2,TODAY())-INT(YEARFRAC(A2,TODAY())))*12) for months. DATEDIF is simpler and more accurate for whole months.

Why does YEARFRAC give a decimal instead of whole years?

YEARFRAC returns the fraction of a year between two dates. Wrap it in ROUND or INT to get whole years.

How do I calculate tenure as of a specific date?

Replace TODAY() with a cell reference containing that date, e.g., =YEARFRAC(A2, $E$1). Lock the reference with dollar signs.

Does DATEDIF work in all Excel versions?

Yes, DATEDIF is available in all modern Excel versions for Windows, Mac, and Excel for the web, though it is not listed in the function wizard.

What if my hire dates include times?

YEARFRAC and DATEDIF ignore the time portion if the cell is formatted as a date. If the time causes issues, use =INT(A2) to strip it.

Can I use this formula in Google Sheets?

Yes. YEARFRAC, DATEDIF, TODAY, and ROUND work the same way in Google Sheets. The syntax is identical.