To calculate professional experience in Excel, use the =DATEDIF(start_date, end_date, "unit") formula. This function calculates the difference between two dates in years, months, or days, allowing you to determine exactly how long an employee has been with a company or how much total experience a candidate possesses based on their resume dates.
What You'll Need
- A computer with Microsoft Excel installed (works in all modern versions including Excel 365, 2021, 2019, and 2016).
- A dataset containing start dates and end dates (or the current date) formatted as Date cells.
- Basic knowledge of how to enter formulas into a cell.
Step-by-Step
- Prepare Your Data Table: Create a table with three columns. Label Column A as "Start Date", Column B as "End Date", and Column C as "Total Experience". Ensure that the dates in Columns A and B are formatted as dates (select the cells, go to the Home tab, and select "Short Date" from the Number format dropdown).
- Handle Current Employees: If a person is still employed, the "End Date" should be today's date. Instead of typing today's date manually, you can use the
=TODAY()function in the End Date cell. This ensures the experience calculator updates automatically every time you open the spreadsheet. - Calculate Total Years: In cell C2, enter the formula
=DATEDIF(A2, B2, "y"). The "y" tells Excel to return the total number of complete years between the two dates. Press Enter. - Calculate Remaining Months: To get a more precise experience measurement (e.g., "5 years and 3 months"), you need a second formula for the months. In cell D2, enter
=DATEDIF(A2, B2, "ym"). The "ym" argument tells Excel to ignore the years and only calculate the months remaining after the full years are subtracted. - Calculate Remaining Days: For absolute precision, you can calculate the days. In cell E2, enter
=DATEDIF(A2, B2, "md"). The "md" argument ignores years and months and only calculates the days remaining. - Combine into a Single Readable String: Instead of having three separate columns, you can combine these into one professional sentence using the concatenation symbol (&). In cell F2, enter the following formula:
=DATEDIF(A2, B2, "y") & " Years, " & DATEDIF(A2, B2, "ym") & " Months, " & DATEDIF(A2, B2, "md") & " Days"This will output a result like "4 Years, 2 Months, 15 Days". - Apply to All Rows: Click the small green square (fill handle) at the bottom-right corner of cell F2 and drag it down to apply the calculation to all employees in your list.
Common Mistakes
One of the most frequent errors is the Date Order Mistake. The DATEDIF function requires the start date to be the first argument and the end date to be the second. If the start date is later than the end date, Excel will return a #NUM! error. Always double-check that your "Start Date" column contains the older date.
Another common issue is Incorrect Unit Syntax. The units ("y", "m", "d", "ym", "md", "yd") must be enclosed in double quotation marks. If you type =DATEDIF(A2, B2, y) without quotes, Excel will treat "y" as a named range or a variable, resulting in a #NAME? error.
Many users also forget to Format the Date Cells. If your dates are entered as text (e.g., "Jan 1st 2020") rather than actual Excel date values, the formula will not be able to perform the math and will return a #VALUE! error. You can verify if a cell is a true date by changing its format to "Number"; if it changes to a five-digit number (like 44197), it is a valid date.
Tips
Using Named Ranges: If you are building a complex HR dashboard, instead of referencing A2 or B2, you can name your columns. Select the start date column and name it "StartDate" in the Name Box (top left). Your formula becomes =DATEDIF(StartDate, EndDate, "y"), which is much easier to read and maintain.
Conditional Formatting for Experience Tiers: You can use Conditional Formatting to highlight employees based on their experience. For example, set a rule that if the "Total Years" cell is greater than or equal to 10, the cell turns green to indicate a "Senior" level employee. Go to Home > Conditional Formatting > Highlight Cells Rules > Greater Than.
Handling Gaps in Employment: If a person has multiple stints at different companies, DATEDIF cannot handle a range of dates in one go. You must create separate rows for each employment period, calculate the duration for each, and then use the =SUM() function to add the total days together. Once you have the total days, you can convert them back to years by dividing by 365.25 (to account for leap years).
Troubleshooting
If you see a #NUM! error: This almost always means your start date is after your end date. Check your data for typos (e.g., entering 2023 instead of 2013). If you are using the =TODAY() function, ensure the start date is actually in the past.
If you see a #VALUE! error: This indicates that one of the cells is not recognized as a date. Try selecting the date columns and using the "Text to Columns" feature (Data tab > Text to Columns > Finish) to force Excel to re-evaluate the data types. Ensure there are no leading spaces before the dates.
If the result is 0 when it should be higher: Check if you used "ym" instead of "y". The "ym" argument only shows the months remaining after full years are counted. If someone has 12 months of experience, "y" will show 1 and "ym" will show 0.
If the formula is not available: DATEDIF is a "hidden" function in Excel. It will not appear in the autocomplete list when you start typing it, and it does not have a tooltip explaining the arguments. This is normal behavior. Simply type the full formula manually, and it will work upon pressing Enter.
Frequently Asked Questions
Does DATEDIF account for leap years?
Yes, DATEDIF is designed to handle the calendar accurately, including leap years, when calculating the difference between two specific dates.
Can I use this formula in Google Sheets?
Yes, the DATEDIF function works identically in Google Sheets as it does in Microsoft Excel.
How do I calculate experience if the end date is blank?
You can use an IF statement: =IF(B2="", DATEDIF(A2, TODAY(), "y"), DATEDIF(A2, B2, "y")). This tells Excel to use today's date if the end date cell is empty.
Is there a simpler way to get just the total months?
Yes, use the "m" unit instead of "ym". The formula =DATEDIF(A2, B2, "m") will give you the total number of months elapsed, regardless of how many years that represents.
Why is my date showing as a number like 45231?
Excel stores dates as sequential serial numbers. If your result cell is formatted as a "Date", it will look like a random date in the year 1900. Change the cell format to "General" or "Number" to see the actual count of years or months.