Skip to content

Lesson 8 of 92 · Free Excel Course

Excel

Excel Date Formulas: TODAY, DATE, DATEDIF and Working Days

How Excel stores dates, then the date formulas you'll use most: TODAY, DATE, EDATE, DATEDIF for age, NETWORKDAYS, WEEKDAY and hours over 24.

Dates trip up more Excel beginners than almost anything else. A date suddenly turns into a five-digit number, a total of hours resets to zero, or an age comes out a year too high. All of it makes sense once you know one secret: to Excel, a date is just a number. This lesson explains that idea, then walks through the date formulas you'll actually use: today's date, building a date, adding days and months, working out an age, counting working days, finding the day of the week and adding up hours. You should already be comfortable typing a simple formula; if not, start with Formulas: the basics.

How Excel stores dates

Excel counts days. January 1, 1900 is day 1, January 2, 1900 is day 2, and so on. January 1, 2026 is day 46023. That count is called a serial number, and the date you see in the cell is just a format laid over it.

Try it:

  1. Type 1/5/2026 in a cell and press Enter. Excel recognises it as a date.
  2. Press Ctrl+1 (Command+1 on a Mac) to open Format Cells.
  3. Choose General and click OK. The cell now shows 46027.
  4. Press Ctrl+Z to put the date format back.

Because dates are numbers, you can add and subtract them like any other number. That's what every formula in this lesson relies on. Times work the same way, as fractions of a day: noon is 0.5 and 6:00 AM is 0.25.

Excel decides which typed text counts as a date from your computer's regional settings, so on a US computer 1/5/2026 means January 5, while in the UK it means 1 May. If Excel doesn't recognise what you type, the entry stays left-aligned as text and date formulas won't work on it.

Mac note: Excel for Windows and Excel 2016 for Mac and later use this same 1900 system. Very old Mac versions defaulted to a 1904 date system, which counts from January 1, 1904. If dates jump by four years and a day when you copy between two workbooks, one of them uses 1904. On Windows check File > Options > Advanced > When calculating this workbook > Use 1904 date system; on a Mac it's under Excel > Preferences > Calculation.

Today's date: TODAY, NOW and the shortcuts

There are two kinds of "today", and picking the wrong one is a classic mistake.

Live dates change by themselves. =TODAY() shows the current date and =NOW() shows the current date and time. Neither needs anything inside the brackets. They update whenever the workbook recalculates, for example when you open it or edit a cell. Use them for things like "days until the deadline" that should always be current.

Fixed dates never change. Use them for "date received" or "date paid", where you want a record of the day you typed it:

  1. Click the cell.
  2. Press Ctrl+; (Ctrl and semicolon) for today's date.
  3. Press Ctrl+Shift+; for the current time.
  4. To get both, press Ctrl+;, then a space, then Ctrl+Shift+;, then Enter.

On a Mac, Ctrl+; also enters the date, but the time shortcut is Command+;. In Excel for the web, Microsoft's help suggests typing the date or time yourself; =TODAY() and =NOW() work the same everywhere.

The TODAY function, NOW function, WORKDAY function and NETWORKDAYS function each have their own reference page with more examples.

Build a date with DATE

When the year, month and day are in separate cells, or you want a date inside a formula without worrying about regional settings, use DATE. Its pattern is =DATE(year, month, day).

  1. Type 2026 in B8 and 7 in C8.
  2. In D8 type =DATE(B8,C8,4) and press Enter.
  3. Excel shows 7/4/2026.

DATE is forgiving. A month of 14 rolls into February of the next year, and a day of 35 in January becomes February 4. That makes it handy for adding years: =DATE(YEAR(A2)+1,MONTH(A2),DAY(A2)) gives the same date next year.

Add days, months and years

Days are the easy part: add a number to a date. If A2 holds 3/2/2026 and B2 holds 30, then =A2+B2 returns 4/1/2026. Subtract to go backwards.

Months are harder, because they're different lengths. Use EDATE, whose pattern is =EDATE(start_date, months):

  1. Click the cell for the answer.
  2. Type =EDATE(A3,3) and press Enter.
  3. If you see a number such as 46175, press Ctrl+1 and choose a Date format. EDATE returns a plain serial number.

Use a negative number to go back: =EDATE(A3,-2). When the start date is the 31st and the target month is shorter, EDATE gives the last day of that month, so January 31 plus one month is February 28 in 2026.

C3=EDATE(A3,B3)
ABC
1StartAddResult
23/2/2026304/1/2026
33/2/202636/2/2026
43/2/2026-21/2/2026
C2 uses =A2+B2 to add 30 days. C3 and C4 use EDATE to add 3 months and go back 2 months. All results are formatted as dates.

For a quick answer without a spreadsheet, our free date calculator adds and subtracts days, weeks, months and years from any date.

Count the days between dates and work out an age

To count days, subtract the earlier date from the later one. From 11/22/2026 to 12/25/2026, =B5-A5 returns 33. If Excel shows the answer as a date, change the format to General or Number. The result doesn't count the start day; add 1 if you need both ends included.

For years and months, use DATEDIF. It's an old function kept for compatibility with Lotus 1-2-3, so it may not pop up in the suggestions as you type, but it works in every current version. The pattern is =DATEDIF(start_date, end_date, unit):

UnitWhat it returns
"y"Complete years
"m"Complete months
"d"Days
"ym"Months left over after the complete years
"yd"Days left over after the complete years

To work out someone's age:

  1. Put the date of birth in B2.
  2. In C2 type =DATEDIF(B2,TODAY(),"y").
  3. Press Enter. The age only ticks up on or after the birthday.
D2=DATEDIF(B2,C2,"y")
ABCDE
1NameBornOn dateYearsMonths
2Sam5/14/199011/22/2026366
D2 uses =DATEDIF(B2,C2,"y") and E2 uses =DATEDIF(B2,C2,"ym"): Sam is 36 years and 6 months old on November 22, 2026.

The start date must come first; if it's later than the end date you get #NUM!. Microsoft warns against the "md" unit (days left after complete months) because it can return wrong or negative results. If you need the leftover days, use =C2-EDATE(B2,DATEDIF(B2,C2,"m")) instead, which gives 8 for Sam.

Working days and the day of the week

NETWORKDAYS counts Monday-to-Friday days between two dates, including both the start and end date. Its pattern is =NETWORKDAYS(start_date, end_date, [holidays]).

  1. Put 5/1/2026 in B9 and 5/31/2026 in C9.
  2. Type =NETWORKDAYS(B9,C9). May 2026 has 21 weekdays.
  3. Put the holiday, 5/25/2026 (Memorial Day), in B13.
  4. Type =NETWORKDAYS(B9,C9,B13). The answer drops to 20.

For a list of holidays, point the third argument at the whole range, such as $B$13:$B$20. If your weekend isn't Saturday and Sunday, the related NETWORKDAYS.INTL function lets you choose which days are off.

WEEKDAY tells you the day of the week as a number. =WEEKDAY(A2) returns 1 for Sunday through 7 for Saturday; =WEEKDAY(A2,2) returns 1 for Monday through 7 for Sunday. March 2, 2026 is a Monday, so the first gives 2 and the second gives 1. For the day's name, use =TEXT(A2,"dddd"), which returns "Monday".

Add up hours past 24

Subtracting times gives a duration: with 9:30 AM in B16 and 5:45 PM in C16, =C16-B16 returns 8:15. The trouble starts when you add up a week of these.

  1. Total the hours with =SUM(D16:D20). Five days of 8:15 should be 41 hours 15 minutes, but Excel shows 17:15.
  2. That's because h:mm is a clock format and starts again after 24 hours. Select the total and press Ctrl+1.
  3. Choose Custom, type [h]:mm in the Type box and click OK.
  4. The total now reads 41:15. The square brackets tell Excel to keep counting hours.
D21=SUM(D16:D20)
ABCD
15DayStartEndHours
16Monday9:30 AM5:45 PM8:15
17Tuesday9:30 AM5:45 PM8:15
18Wednesday9:30 AM5:45 PM8:15
19Thursday9:30 AM5:45 PM8:15
20Friday9:30 AM5:45 PM8:15
21Week total41:15
The total in D21 uses the [h]:mm format, so it shows 41:15. With plain h:mm the same value would display as 17:15.

Microsoft notes that Excel for the web can add and subtract times over 24 hours but doesn't let you apply a custom number format, so open the file in the desktop app to set [h]:mm if you can't find Custom. Our free time calculator is a quick way to double-check a total.

Change how a date looks

The format changes the look, never the value. Select the cells, press Ctrl+1, choose Date and pick a style, or choose Custom and type a code: d-mmm-yyyy shows 2-Mar-2026, mmmm yyyy shows March 2026, and dddd shows Monday. In Excel for the web, use the number format box on the Home tab and choose Short Date or Long Date. More on number formats is in Format cells.

Try it yourself

Download the practice workbook and open the Practice sheet. Each yellow cell in column D needs a formula.

  1. D2: add 30 days with =B2+C2.
  2. D3 and D4: add 3 months and go back 2 months with EDATE.
  3. D5: count the days until December 25.
  4. D6 and D7: work out the age in years and leftover months with DATEDIF.
  5. D8: build July 4, 2026 with DATE.
  6. D9 and D10: count working days in May 2026, then again without Memorial Day.
  7. D11 and D12: find the weekday number and day name for March 2, 2026.
  8. D16 to D21: fill in the timesheet, then format the total as [h]:mm.

Check against the Answers sheet, where every formula has been tested.

Common mistakes

  • Dates typed as text. If a date sits on the left of the cell, Excel didn't recognise it. Retype it in your computer's date order, or build it with DATE.
  • A date that shows as a number, or a day count that shows as a date. Only the format is wrong; fix it with Ctrl+1.
  • Using TODAY for a record date. It changes tomorrow. Use Ctrl+; for a fixed date.
  • Adding 30 days when you mean a month. Use EDATE for months.
  • Putting the later date first in DATEDIF. That gives #NUM!.
  • Relying on DATEDIF's "md" unit. Microsoft warns it can be wrong.
  • Hour totals that wrap. Use [h]:mm on the total cell.

What's next

Dates work hand in hand with totals, so if you skipped it, read Add and SUM. To tidy up long lists of dates, see Rows and columns. Sort and filter shows how to put dates in order. The full outline is on the free Excel course page.

Frequently asked questions

Why does my date show as a number like 46027?

Excel stores every date as a serial number, the count of days since January 1, 1900. 46027 is January 5, 2026. The value is fine; only the format is wrong. Select the cell, press Ctrl+1, choose Date and pick a style.

How do I put today's date in a cell so it doesn't change?

Press Ctrl+; (Ctrl and semicolon). That types today's date as a fixed value. `=TODAY()` does the opposite: it updates to the current date every time the workbook recalculates.

How do I calculate age in Excel?

Use `=DATEDIF(B2,TODAY(),"y")`, where B2 holds the date of birth. The "y" unit counts complete years, so the age only goes up on or after the birthday.

How do I add months to a date in Excel?

Use EDATE: `=EDATE(A2,3)` returns the same day three months later, and `=EDATE(A2,-3)` goes back three months. Adding 90 days is not the same thing, because months have different lengths.

How do I count working days between two dates?

Use `=NETWORKDAYS(A2,B2)`. It counts Monday to Friday, including both the start and end dates. Add a range of holiday dates as a third argument to skip those too. To check a result, try our free date calculator.

Why do my hours reset after 24 when I add them up?

The normal `h:mm` format shows the time of day, so 41 hours appears as 17:15. Give the total cell the custom format `[h]:mm` (Ctrl+1, then Custom) and Excel shows 41:15.