How to Average Years and Months in Excel
In this article
To average years and months in Excel, convert each duration to a single unit (months is easiest), average those numbers with AVERAGE, then convert the result back to years and months. For example, if A2:A4 contain 2 years 6 months, 3 years 0 months and 1 year 9 months, put =ROUND(AVERAGE((LEFT(A2:A4,1)*12+MID(A2:A4,3,2))),0) in a cell (entered as an array formula in older Excel) to get the average in months, then divide by 12 for years and use MOD for the leftover months. The exact formula depends on whether your data is stored as text, as separate year and month columns, or as real Excel dates.
What You'll Need
- Excel 2016 or later, Microsoft 365, or Excel for Mac. The formulas below also work in Excel 2010 and 2013, but dynamic arrays (used in some examples) require Microsoft 365 or Excel 2021 and later.
- Your durations in a consistent format: either text like "2y 6m", separate Year and Month columns, or real dates where the difference represents a duration.
- A blank cell for the result, plus a couple of helper columns if you use the text method.
Step-by-Step
- Decide on your unit. Averaging years and months only works if you convert everything to one unit first. Months is the safest choice because it avoids decimals like 2.75 years and makes the final conversion clean. Multiply years by 12 and add the months.
- If your data is in separate Year and Month columns (say B2:B10 for years and C2:C10 for months), add a helper column D with
=B2*12+C2and fill down. Then in an empty cell enter=AVERAGE(D2:D10)to get the average in months. - Convert the average back to years and months. If the average months value is in E2, use
=INT(E2/12)&" years "&MOD(E2,12)&" months"to display it as text. For a numeric result, put=INT(E2/12)in one cell for years and=MOD(E2,12)in another for months. - If your data is text like "2y 6m", you need to parse it. Assuming the format is always one digit for years, a space, then two digits for months (for example "2y 06m"), use a helper column with
=VALUE(LEFT(A2,FIND("y",A2)-1))*12+VALUE(MID(A2,FIND("y",A2)+1,FIND("m",A2)-FIND("y",A2)-1)). This extracts the year number, multiplies by 12, and adds the month number. Fill down, then average the helper column. - If your data is real dates representing durations (for example a start date and end date in separate columns), subtract the start from the end to get days, divide by 30.44 to approximate months, then average. Be aware this is approximate because months have different lengths. For exact calendar months, use
=DATEDIF(start,end,"m")in a helper column, then average that column. - Round sensibly. Averages rarely come out as whole months. Wrap the AVERAGE in ROUND, for example
=ROUND(AVERAGE(D2:D10),0), so the final years and months are whole numbers. If you need more precision, keep one decimal place in months and convert the decimal to days by multiplying by 30.44. - Format the result. If you used the text formula, the cell shows something like "2 years 8 months". If you used separate numeric cells, format them as General or Number with zero decimals. Avoid Excel's date format, which will misinterpret a number like 32 as a date.
- Check with a manual example. Average 2y 6m (30 months), 3y 0m (36 months) and 1y 9m (21 months): total 87 months, average 29 months, which is 2 years 5 months. If your formula returns something else, the parsing step is the likely culprit.
Common Mistakes
- Averaging the year and month parts separately. Averaging years (2, 3, 1 = 2) and months (6, 0, 9 = 5) gives 2 years 5 months here, which happens to match, but it often does not because month remainders do not carry correctly. Always convert to months first.
- Leaving durations as text. AVERAGE ignores text, so if your cells contain "2y 6m" the function returns #DIV/0! or zero. Parse to numbers first.
- Using 30 days per month for exact calendar work. Dividing total days by 30 or 30.44 is fine for rough estimates but drifts over long periods. Use DATEDIF with "m" when you need exact calendar months.
- Forgetting array entry in older Excel. Formulas that operate on a range inside LEFT or MID need Ctrl+Shift+Enter in Excel 2019 and earlier. In Microsoft 365 they spill automatically.
- Formatting a month count as a date. A result of 29 formatted as a date shows as 29 Jan 1900. Set the cell format to General or Number.
Tips
- Keep a helper column for the month conversion. It makes the sheet auditable and lets you spot parsing errors row by row.
- Use
=SUMPRODUCTwith your conversion formula to average without a helper column, for example=SUMPRODUCT(B2:B10*12+C2:C10)/COUNT(B2:B10). - If you need the average expressed as a decimal number of years, divide the average months by 12 and format to two decimals.
- Name your ranges (Formulas > Define Name) so formulas read clearly and are easier to update when rows are added.
- Test with a small set where you know the answer before applying the formula to hundreds of rows.
Troubleshooting
- #VALUE! error: A cell contains text that the formula cannot parse, often an extra space or a different separator. Check for leading spaces and use TRIM.
- #DIV/0! error: AVERAGE found no numbers. Confirm the helper column contains numeric values, not text that looks like numbers. Convert with VALUE or multiply by 1.
- Result looks like a date: Change the cell format to General or Number.
- Average seems too high or too low: Check whether any duration was entered as 18 months instead of 1 year 6 months, which double-counts if you also add years. Standardise the input format.
- Formula returns 0: In older Excel, an array formula entered without Ctrl+Shift+Enter may evaluate only the first cell. Re-enter with the correct key combination.
- DATEDIF returns #NUM!: The end date is earlier than the start date. Swap the arguments.
Frequently Asked Questions
Can Excel average text like "2 years 6 months" directly?
No. AVERAGE ignores text. You must parse the text into a number of months first, then average that helper column.
Should I convert to months or years?
Months. It avoids decimals and carries correctly when you convert back to years and months.
Why does my result show a date?
Excel applied a date format to a whole number. Set the cell format to General or Number.
How do I average durations stored as start and end dates?
Add a helper column with =DATEDIF(start,end,"m"), then average that column. This gives exact calendar months.
Do I need an array formula?
Only in Excel 2019 and earlier when a formula processes a range inside LEFT, MID or similar functions. Microsoft 365 and Excel 2021 handle it automatically.
Can I get the average as "X years Y months" in one cell?
Yes. Use =INT(AVERAGE(range)/12)&" years "&ROUND(MOD(AVERAGE(range),12),0)&" months", replacing range with your month helper column.