ShareYourGroupShareYourGroupExcel Formulas

Guides

Date formulas in Excel: age, days between, due dates

Dates in Excel follow one idea. Once it is clear, the formulas for ages, deadlines and month ends become straightforward. This page starts with that idea and then gives a formula for each common task.

A date is a number

Excel stores every date as a count of days. Day 1 is 1 January 1900, and each day after it adds one. What you see as 12-Nov-2026 is the number 46338 with a date format on top. A time of day is a fraction: 0.5 is noon.

Three things follow.

Sample sheet: Staff with their date of birth and date of joining, and a short list of holidays.
ABCD
1NameBornJoinedHoliday
2Anita19-Jul-198801-Apr-201926-Jan-2026
3Rohit30-Nov-199215-Jun-202004-Mar-2026
4Deepa29-Feb-199601-Sep-202115-Aug-2026
5Manoj05-Dec-199910-Jan-202202-Oct-2026

The examples use a fixed date, 12 November 2026, in place of TODAY(), so that the results on this page do not change. In your own sheet, write TODAY() there.

Days between two dates

Just subtract: the later date minus the earlier. Format the result as General or Number. If it appears as a date in 1900, the cell has inherited a date format.

To count both the first and the last day, add 1.

Age in completed years

DATEDIF counts whole years, so the age rises on the birthday and not before. Rohit's birthday falls at the end of November, so on 12 November he has not yet turned a year older. Dividing the days by 365 would get cases like his wrong.

Length of service is the same formula with the joining date.

A date some days, months or years ahead

Add days directly. For months and years use EDATE, which knows that months have different lengths. Ninety days and three months are not the same date.

The end and the start of a month

In order: the last day of the month of the date in C3, the first day of that month, the first day of the next month, and the number of days in the month.

The day of the week

TEXT gives the name. WEEKDAY with 2 as its second argument gives a number where Monday is 1 and Sunday is 7, so anything above 5 is the weekend.

Working days

NETWORKDAYS counts Monday-to-Friday days between two dates, less any holidays in the list. WORKDAY finds the date a number of working days ahead. For a six-day week, use the .INTL versions with weekend code 11.

Year, month, quarter and financial year

The last formula gives the Indian financial year, April to March, in the form 2020-21. A date from January to March belongs to the year that began the previous April. See YEAR, MONTH and DAY.

Overdue, due soon, on time

With a due date in a cell and today's date, a status is a pair of comparisons.

Used as Conditional Formatting rules, the same tests colour overdue rows red.

The next birthday or anniversary

The first is this year's birthday. The second is the next birthday on or after today: the completed years plus one, added to the date of birth. The third counts the days until it.

Entering dates so that Excel understands them

Dates that are really text

Imported data often has dates as text. Signs: left-aligned, and =ISNUMBER(A2) is FALSE. Cures:

Common mistakes

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.