How to Calculate Exact Age in Years, Months, and Days Using Excel
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.

- 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.
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.
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.
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.
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 "})
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 Traditional Cell References
If your data is not stored in an Excel Table or your spreadsheet version does not support array concatenation, you can combine multiple standard DATEDIF formulas into one cell.
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. Open your spreadsheet: Launch WPS Spreadsheet and open the file containing your patient Date of Birth and Arrival Date data.
- 2. Input the DATEDIF formula: Select the target cell and type in the standard DATEDIF formula referencing your dates.
- 3. Get exact results: Press Enter to instantly reveal the exact age calculated in years, months, and days.

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 ", "").




