Home  /  Blog  /  Date & Text
Date & Text

Excel Date Formula — The Complete Guide to Date Functions in Excel

By admin 26 November 2026 Date & Text

Every date formula in Excel is built on one rule: a date is a number. January 1, 1900 is 1, January 2, 1900 is 2, and March 26, 2026 is 46,107 — the count of days since January 1, 1900. That is why date arithmetic works so reliably: subtracting one date from another gives the days between them, and adding 30 to a date gives the date 30 days later. Once you know that, the functions fall into place: TODAY gives you today’s number, DATE builds a number from its parts, DATEDIF measures the gap between two numbers, and EDATE and EOMONTH move a number by months instead of days. This guide gives you the rule first, then the function finder, then one worked example per function, and the mistakes that catch everyone.

Quick takeaway: a date is a number — that is why the arithmetic works.

  • =TODAY() — today’s date, updating on every recalculation.
  • =DATE(2026, 12, 25) — build a date from year, month and day.
  • =B2 - A2 — the days between two dates. No function needed.
  • =DATEDIF(A2, B2, "Y") — the complete years between two dates.
  • =EDATE(A2, 3) — three months later, same day of the month.
  • =EOMONTH(A2, 0) — the last day of A2’s month.
Excel Date Formula — The Complete Guide to Date Functions in Excel

The Function Finder — Which Formula for Which Job?

Your jobUseExample
Today’s dateTODAY=TODAY()
Today’s date and timeNOW=NOW()
Build a date from partsDATE=DATE(2026, 12, 25)
Pull the year, month or day outYEAR, MONTH, DAY=YEAR(A2)
Days between two datesSubtract, or DAYS=B2 - A2
Years or months between datesDATEDIF=DATEDIF(A2, B2, "Y")
Add months to a dateEDATE=EDATE(A2, 3)
Last day of the monthEOMONTH=EOMONTH(A2, 0)
Day of the weekWEEKDAY or TEXT=WEEKDAY(A2, 2)
Working days between datesNETWORKDAYS=NETWORKDAYS(A2, B2)

1. Today’s Date — TODAY and NOW

=TODAY()
=NOW()

TODAY returns the current date with no time component. It updates automatically every time the workbook recalculates, so formulas that reference it always stay current. NOW works the same way but includes the current time as a decimal portion of the serial number. That makes TODAY the right choice for “days since the order” (=TODAY() - A2), and the wrong choice when you need a number to stay fixed in a report you are saving — paste the value instead.

2. Build a Date — DATE

=DATE(year, month, day)

DATE builds a date serial number from separate year, month and day values. =DATE(2026, 6, 15) gives June 15, 2026. =DATE(YEAR(A2), MONTH(A2), 1) gives the first day of A2’s month. DATE also handles overflow: month 13 rolls into the next year, month 0 is the previous December, and day 0 is the last day of the previous month.

FormulaResult
=DATE(2026, 6, 15)June 15, 2026
=DATE(2026, 13, 1)January 1, 2027
=DATE(2026, 0, 1)December 1, 2025
=DATE(2026, 3, 0)February 28, 2026
=DATE(2026, 1, 0)December 31, 2025

3. Pull a Date Apart — YEAR, MONTH, DAY

=YEAR(A2)
=MONTH(A2)
=DAY(A2)

For March 15, 2026 in A2: YEAR gives 2026, MONTH gives 3, DAY gives 15. These three are the parts DATE puts back together, and they are the pieces of every date breakdown — a month key for grouping, a year for filtering, a day for checking.

4. Days Between Two Dates — Subtract

=B2 - A2

Because dates are numbers, subtraction gives a duration in days. An order on January 5, 2026 (serial 46,027) and an order on March 9, 2026 (serial 46,090) are 46,090 − 46,027 = 63 days apart. Adding works too: January 5, 2026 + 30 = February 4, 2026. DAYS does the same job as a function: =DAYS(B2, A2) gives the same 63. The full guide to counting the days between two dates is the months between dates guide.

5. Years and Months Between Dates — DATEDIF

=DATEDIF(start_date, end_date, "Y")

DATEDIF calculates the difference between two dates in complete years, months or days. It does not appear in Excel’s autocomplete, and you will not find it in the function wizard — but it works, and it has been available since Excel 2000. The unit argument tells it what to measure: “Y” for complete years, “M” for complete months, “D” for days.

Formula (hire date 10 Mar 2021, end date 27 Feb 2026)Result
=DATEDIF(A2, B2, "Y")4 complete years
=DATEDIF(A2, B2, "M")59 complete months
=DATEDIF(A2, B2, "D")1,815 days

The start date must be earlier than the end date, or DATEDIF returns #NUM!. The full guide to the months between two dates is the months between dates guide, and the age calculation is the Calculate Age page, which is planned next in this silo.

6. Add Months to a Date — EDATE

=EDATE(A2, 3)

EDATE returns the same day of the month, shifted by the number of months you specify. Months can be negative to go back. Adding 30 days is not the same as adding one month — month functions handle the varying lengths for you. January 30, 2026 + 1 month is February 28, 2026, not March 2 — EDATE clamps the day to the end of the shorter month.

Start dateFormulaResult
15 Jan 2026=EDATE(A2, 3)15 Apr 2026
15 Jan 2026=EDATE(A2, -2)15 Nov 2025
30 Jan 2026=EDATE(A2, 1)28 Feb 2026

The full guide to adding months is the add months to date guide.

7. Last Day of the Month — EOMONTH

=EOMONTH(A2, 0)

EOMONTH returns the last day of the month that is that many months away. 0 means the same month. It is the standard way to get month-end dates — and =EOMONTH(A2, -1) + 1 is the standard way to get the first day of the month: the end of last month, plus one day.

Start dateFormulaResult
15 Jan 2026=EOMONTH(A2, 0)31 Jan 2026
15 Jan 2026=EOMONTH(A2, 1)28 Feb 2026
15 Jan 2026=EOMONTH(A2, -1)31 Dec 2025
30 Jan 2026=EOMONTH(A2, 0)31 Jan 2026

8. Day of the Week — WEEKDAY and TEXT

=WEEKDAY(A2, 2)
=TEXT(A2, "dddd")

WEEKDAY returns the day of the week as a number: with return_type 2, Monday is 1 and Sunday is 7, which is what most work calendars use. TEXT gives the name: “dddd” for Friday, “ddd” for Fri. The full guide, with the worked table and the weekend test, is the day of week formula guide.

9. Working Days Between Dates — NETWORKDAYS

=NETWORKDAYS(A2, B2)

NETWORKDAYS counts whole working days (Monday to Friday) between two dates, including both ends, minus any dates in the optional holidays range. January 5, 2026 is a Monday and January 16 is a Friday — two full work weeks — so =NETWORKDAYS(DATE(2026,1,5), DATE(2026,1,16)) gives 10. If January 12 is a holiday, the same formula with the holiday range gives 9. The full guide to working days is the Working Days Between Dates page, which is planned next in this silo.

Common Mistakes

MistakeWhat happensFix
Your date shows as a number like 46027The cell is formatted as General, not as a dateFormat the cell as a date
Your date is text, not a real date#VALUE! — no date function will work on it=ISNUMBER(B2) is FALSE for text; convert with DATEVALUE, retype it, or rebuild with DATE
You typed a date string inside a formula“03/04/2026” can mean March 4 or April 3, depending on regional settingsUse =DATE(2026, 3, 4) — it cannot be misread
You added 30 days to add one monthThe result is 30 days later, not one month laterUse EDATE for months
You used DATEDIF with the start date after the end date#NUM!Swap the dates, or check the order first
You expected DATEDIF in autocompleteIt is not there — it is a legacy function, undocumented since Excel 2000Type it anyway; it works
You used TODAY in a report you savedThe number changes every time the workbook recalculatesPaste the value instead

Frequently Asked Questions

What is the Excel date formula? There is no single date formula — there is a family of them, all built on the rule that a date is a number. TODAY gives today’s date, DATE builds one, DATEDIF measures the gap between two, EDATE adds months, and EOMONTH gives the last day of the month.

How do I get today’s date in Excel? =TODAY() returns the current date and updates automatically. =NOW() returns the current date and time.

How do I calculate the days between two dates in Excel? Subtract them: =B2 - A2. For complete years or months, use =DATEDIF(A2, B2, "Y") or =DATEDIF(A2, B2, "M").

How do I add months to a date in Excel? =EDATE(date, months). For example, =EDATE(A2, 3) gives the date three months after A2, on the same day of the month.

How do I get the last day of the month in Excel? =EOMONTH(date, 0). For the first day of the month, use =EOMONTH(date, -1) + 1.

Why does my date show as a number? Because Excel stores dates as serial numbers — January 1, 1900 is 1, March 26, 2026 is 46,107. Format the cell as a date and the number displays as a date.

Why does my date formula say #VALUE!? The cell holds text that looks like a date, not a real date. Check with =ISNUMBER(cell) — FALSE means text. Convert it with DATEVALUE, retype it, or rebuild it with DATE.

That is the Excel date formula — not one formula, but a family of them, all built on the one rule that a date is a number. TODAY gives you today’s number, DATE builds one from its parts, subtraction gives the days between two, DATEDIF gives the years and months, EDATE moves a date by months, and EOMONTH finds the end of the month. Remember the two things that matter: never type a date string into a formula, because regional settings can read it the wrong way — build it with DATE — and never add 30 days when you mean one month, because months are not 30 days long. From here, the next date jobs to learn are the ones this page points to — the months between dates guide, the add months to date guide, and the day of week formula guide — and the full learning order for the whole site is on the Excel Formulas hub.


About admin

Author of Excel formula guides on this blog.

View all guides by admin →

Keep Learning

Related guides