Function Problems

How to Calculate Exact Age in Years, Months, and Days Using Excel

Maira MehtabMaira Mehtab Nov 10, 2026 868 views

Question details

The user needs a formula to calculate a child's exact age in years, months, and days based on their Date of Birth and the specific Date of Arrival at an emergency department.

How to Calculate Exact Age in Excel (Years, Months, Days)
Product
Spreadsheet
Device & OS
not provided
Scenario
Determining the precise elapsed time between two specific dates (Date of Birth and Arrival Date) and formatting the output as a readable string.
Observed behavior
The user wants a customized text output showing the exact breakdown of the elapsed time, such as '4 years 3 months 13 days' or '4y 3m 13d', rather than a single number of total days.
Before you start

Make sure your Date of Birth and Arrival Date columns are formatted as standard dates, not as plain text. Verify that all Arrival Dates strictly occur after the Dates of Birth to avoid calculation errors.

Solution 1Recommended

Calculate Age Using DATEDIF in an Excel Table

If your data is formatted as an Excel Table, you can use structured references alongside the DATEDIF and CONCAT functions to automatically generate age calculations for all rows.

Using structured table references like [@DOB] ensures that as you add new rows to your dataset, the formula will automatically apply without you needing to drag it down manually.

1
Ensure your data is in an Excel Table

Make sure your Date of Birth and Arrival Date columns have headers (e.g., 'DOB' and 'Arrival') and are formatted as an official Table by selecting your data and pressing Ctrl + T.

2
Enter the dynamic formula

Click into the first blank cell of your target 'Age' column. Type the following formula: =CONCAT(DATEDIF([@DOB],[@Arrival],{"y","ym","md"})&{"y ","m ","d "})

3
Review the calculated results

Press Enter. The formula calculates the elapsed years, remaining months, and remaining days, and combines them into a string format like '4y 3m 13d'. The results will cascade automatically down the entire table.

Calculate Age Using DATEDIF in an Excel Table
Dynamic Array Support: If you are using a modern spreadsheet version supporting dynamic arrays, the concatenated output using array constants {"y","ym","md"} works perfectly to consolidate the text strings instantly.
Calculate Dates Seamlessly

Use WPS Spreadsheet to Process Complex Date Formulas

WPS Spreadsheet fully supports advanced date and time functions, including DATEDIF, allowing you to accurately calculate precise ages or elapsed time between dates with zero hassle.

  1. 1. Open your spreadsheet: Launch WPS Spreadsheet and open the file containing your patient Date of Birth and Arrival Date data.
  2. 2. Input the DATEDIF formula: Select the target cell and type in the standard DATEDIF formula referencing your dates.
  3. 3. Get exact results: Press Enter to instantly reveal the exact age calculated in years, months, and days.
Fully compatible with Microsoft Excel date formulas like DATEDIF and CONCATLightweight application that processes large healthcare or enterprise datasets instantlyFree to use with a familiar, user-friendly interface that requires no learning curve
QA img-9

Frequently Asked Questions

Why does my DATEDIF formula return a #NUM! error?

The #NUM! error typically occurs if the start date (Date of Birth) is chronologically later than the end date (Arrival Date). Check your data entries to ensure all arrival dates happen after the birth dates.

How do I calculate just the total elapsed months between two dates?

If you only need the total number of months rather than a combined breakdown, use the "m" parameter instead. For example: =DATEDIF(Start_Date, End_Date, "m").

Will this formula update if I modify the patient's arrival date?

Yes. DATEDIF uses dynamic cell references, meaning anytime you update the Date of Birth or the Arrival Date, the formula will automatically recalculate the exact age instantly.

How can I hide sections that show 0, like '0 years' or '0 months'?

To omit zero values, you can wrap each DATEDIF segment in an IF statement to check if the value is greater than zero before displaying the text, for example: =IF(DATEDIF(D2,C2,"y")>0, DATEDIF(D2,C2,"y")&" years ", "").