Excel course · Lesson 20 of 34

Dates and times: serial numbers, date math and working days

Understand how Excel stores dates and times, calculate due dates, ages and durations, add months, find month ends and count working days.

Intermediate 18 min read

Dates confuse many Excel users until they learn one fact: a date is just a number. Excel counts days from a fixed starting point, and a time is a fraction of a day. Once you see dates as numbers, adding 30 days to an invoice date, counting the days between two dates or working out hours worked becomes simple arithmetic. This lesson explains the system, then the functions that handle months, ages and working days.

Dates are serial numbers

In Excel for Windows and current Excel for Mac, day 1 is 1 January 1900. Every day after that adds 1. So 1 January 2026 is serial number 46023 and 15 March 2026 is 46096. The date format only changes how that number is displayed.

DateSerial number
1900-01-011
2026-01-0146023
2026-03-1546096
2026-12-3146387
  1. Type 2026-03-15 into a cell. Excel recognises it as a date.
  2. Press Ctrl+1 and choose Number › General. The cell shows 46096.
  3. Choose Date again to switch back. Nothing about the value changed.

Times are fractions: 12:00 noon is 0.5, 06:00 is 0.25, and 14:30 is 0.604166…. A date with a time is a number with decimals: 15 March 2026 at 18:00 is 46096.75.

Note. Excel deliberately treats 1900 as a leap year (29 February 1900 exists in Excel, though not in reality), for compatibility with very old spreadsheet programs. It only matters for dates before March 1900. Very old Mac workbooks used a 1904 date system; check File › Options › Advanced › Use 1904 date system if dates from another file appear four years off.

Entering dates reliably

  • 2026-03-15 (ISO format) is understood in every region.
  • 15-Mar-2026 is also unambiguous.
  • 03/04/2026 is 3 April in Europe and 4 March in the US. Avoid it when sharing files internationally.
  • Ctrl+; inserts today's date as a fixed value; Ctrl+Shift+; inserts the current time (Mac: Cmd+; for the time on some versions; Ctrl+; works for the date).
  • TODAY returns today's date and NOW the date and time; both update whenever the workbook recalculates.

To build a date from separate numbers, use DATE: =DATE(2026, 3, 15). DATE handles overflow sensibly: =DATE(2026, 14, 1) is 1 February 2027, and =DATE(2026, 3, 0) is the last day of February 2026. To take dates apart, use YEAR, MONTH and DAY.

Date arithmetic

E2fx=D2-C2
ABCDE
1InvoiceInvoice dateDue datePaid onDays late
2INV-5012026-02-022026-03-042026-03-2016
3INV-5022026-02-162026-03-182026-03-10-8

C2 =B2+30 (payment terms 30 days). E2 =D2-C2 gives days late; negative means early.

Result: 16

  • Due date: =B2+30. February 2026 has 28 days, so 2 February + 30 is 4 March.
  • Days between two dates: subtract, =D2-C2. If the result appears as a date such as 1900-01-16, change the cell format to General or Number.
  • Days until a deadline: =C2-TODAY().
  • Days late, never negative: =MAX(0, D2-C2).

Months, years and ages

Adding months cannot be done by adding 30. Use EDATE to move a date by whole months and EOMONTH to jump to the end of a month.

FormulaResultUse
=EDATE("2026-01-31", 1)2026-02-28Contract renewal one month later (clamped to month end)
=EDATE(B2, 12)same date next yearAnnual review
=EOMONTH("2026-02-10", 0)2026-02-28Last day of the same month
=EOMONTH("2026-02-10", 1)2026-03-31Last day of the next month
=EOMONTH(B2, -1)+1first day of B2's monthMonth start, handy for SUMIFS criteria

For an age or length of service in whole years, the hidden function DATEDIF is still the simplest. It does not appear in AutoComplete, but it works in every version:

D2fx=DATEDIF(B2, C2, "y")
ABCD
1EmployeeBirth dateOn dateAge
2Laura Kim1990-07-142026-12-0236

Complete years between the two dates. Use "m" for months and "d" for days.

Result: 36

=DATEDIF(B2, C2, "y")&" years, "&DATEDIF(B2, C2, "ym")&" months" returns 36 years, 4 months. YEARFRAC returns a fractional number of years (36.38…), useful for interest calculations.

Watch out. Do not calculate age with =(C2-B2)/365. Leap years make it wrong around birthdays. Use DATEDIF or INT(YEARFRAC(B2, C2, 1)).

Weekdays and working days

  • WEEKDAY returns the day number. With the second argument 2, Monday is 1 and Sunday is 7: =WEEKDAY("2026-03-15", 2) returns 7 (a Sunday).
  • To show the day name, use the format dddd or =TEXT(A2, "dddd"), which returns Sunday.
  • NETWORKDAYS counts working days (Monday–Friday) between two dates, inclusive, minus an optional list of holidays.
  • WORKDAY adds a number of working days to a date, skipping weekends and holidays.
  • NETWORKDAYS.INTL and WORKDAY.INTL let you choose the weekend, for example Friday–Saturday, or a six-day week.
D2fx=NETWORKDAYS(A2, B2, C2)
ABCD
1StartEndHolidayWorking days
22026-03-022026-03-312026-03-2521

March 2026 from Monday the 2nd has 22 weekdays; one holiday leaves 21.

Result: 21

A task that starts on Friday 20 March 2026 and needs 10 working days finishes on =WORKDAY("2026-03-20", 10), which is Friday 3 April 2026. Keep public holidays in a table on a separate sheet and refer to the whole column, so every formula uses the same list.

Working with times

Because times are fractions of a day, the difference between two times is also a fraction. Multiply by 24 to get hours as a normal number, for example to calculate pay.

C2fx=MOD(B2-A2, 1)
ABCDE
1StartEndHours (time)Hours (number)Pay at 15/h
222:0006:308:308.5127.5

A night shift crosses midnight. MOD(…,1) adds a day when the end is earlier than the start. D2 =C2*24, E2 =D2*15.

Result: 8:30

  • =B2-A2 gives a negative number for a night shift, which Excel displays as #####. =MOD(B2-A2, 1) fixes it.
  • Totals of more than 24 hours need the format [h]:mm (Number formats and custom format codes).
  • To convert 8.5 hours back to a time, divide by 24: =8.5/24 formatted as h:mm shows 8:30.
  • HOUR, MINUTE and SECOND extract parts; TIME builds a time: =TIME(8, 30, 0).

Dates stored as text

If a date is left-aligned, subtracting it returns #VALUE! and SUMIFS ignores it. Test with =ISNUMBER(A2). Convert with Data › Text to Columns › Date: DMY (or MDY), with DATEVALUE, or in Power Query with the correct locale. More in Text cleanup: TRIM, CLEAN, TEXTSPLIT, Flash Fill and Text to Columns.

Check yourself

1. What is stored in a cell that shows 2026-01-01?

2. Which formula returns the same day one month later, adjusted for short months?

3. A shift starts at 22:00 and ends at 06:00. Which formula gives 8:00?

4. C2 contains 7:30 (a time). Which formula gives the pay at 20 per hour?

5. Which function counts weekdays between two dates, excluding holidays?

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB