Tabellab

How Excel Stores Dates: Serial Numbers, DATE, YEAR & TEXT

Lesson 1 of 20Lab

All lessons
  1. How Excel Stores Dates: Serial Numbers, DATE, YEAR & TEXTLabFree
  2. EDATE & EOMONTH: Renewals, Due Dates & Fiscal PeriodsLab Locked
  3. NETWORKDAYS & WORKDAY with Holidays and Custom WeekendsLab Locked
  4. DATEDIF & YEARFRAC: Age, Tenure and Pro-Rata AmountsLab Locked
  5. WEEKDAY, WEEKNUM & ISOWEEKNUM: A Weekly Revenue ReportLab Locked
  6. Time Math: Hours Worked, Overnight Shifts, MOD & ×24Lab Locked
  7. Weekly Timesheet: Regular Hours, Overtime & PayLab Locked
  8. Project Schedule: WORKDAY Chains & a Gantt-Style Bar ChartLab Locked
  9. Imported Dates: Turning yyyymmdd Numbers and dd.mm.yyyy Text into Real DatesLab Locked
  10. Date-Time Stamps: INT, HOUR & Response Times in HoursLab Locked
  11. Business-Hours Elapsed Time: Counting Only Opening Hours Between Two TimestampsLab Locked
  12. Recurring Dates: the 2nd Tuesday, the Last Friday & Paydays That Move Before WeekendsLab Locked
  13. Annual Inspections: Next Anniversary Date, Days Until & Booking FlagsLab Locked
  14. Period Totals with Date Criteria: Month-to-Date, Last Month & Same Period Last YearLab Locked
  15. Turnaround Times: Days to Close, Median vs Average & a HistogramLab Locked
  16. Date Quality Checks: Text Dates, End Before Start, Future and Weekend EntriesLab Locked
  17. Route Timing: Arrival Chains with TIME, Customer Windows & the Return to DepotLab Locked
  18. Billing Call-Outs: Rounding Up to 15 Minutes, Minimum Charges & After-Hours RatesLab Locked
  19. Monthly Capacity: Workdays per Month, Leave, Available Hours & UtilisationLab Locked
  20. Final Project: Service Contract Date Dashboard with Renewal Status & ChartLab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — $9.90
Loading the spreadsheet…

Why dates confuse people, and why they do not have to

Dates are everywhere in business spreadsheets: invoice dates, due dates, start dates, ticket logs, delivery schedules, payroll periods. They are also the source of some of the most confusing moments in Excel. A formula that should return a number of days suddenly shows 9 January 1900. A sort puts April before January. A lookup refuses to match a date that is clearly there. Almost all of these problems disappear once you understand one simple fact: Excel stores every date as a number.

This lesson is for office workers, analysts, team leads, students and anyone who builds reports with dates in them. In the free lab above you work with the service-ticket log of Kestrel Facility Services, a fictional building-maintenance company. You count how many days each ticket was open, pull out the year, label the month with TEXT and schedule a follow-up visit on the first day of the following month with DATE. This article explains the same steps in more depth, shows the numbers behind the dates and covers the traps that trip up even experienced users.

Everything later in this course, from due dates and working days to timesheets and project schedules, rests on the ideas in this first lesson. Learn how dates are stored and you can calculate with them as confidently as with any other number.

The core concept: dates are serial numbers

In the default date system that Excel for Windows and current versions of Excel for Mac use, the first of January 1900 is day 1, the second of January 1900 is day 2, and every day since then has added one. The first of January 2026 is day 46023. That count is called the serial number of the date. When you type 15/12/2025 or 15 Dec 2025 into a cell, Excel recognises the pattern, stores 46006 and applies a date format so that you see a date instead of the number.

Date shownSerial number storedNote
1 Jan 19001Day 1 of the 1900 date system
24 Nov 202545985T-1041 opened
15 Dec 202546006T-1042 opened
1 Jan 202646023The anchor value printed under the lab
6 Jan 202646028T-1042 closed: 46028 − 46006 = 22
30 Apr 202646142T-1048 closed
15 Dec 2025, 12:0046006.5Times are fractions of a day

You can prove this to yourself in two seconds. Select any date cell and change its format to General with Home > Number Format > General, or press Ctrl+Shift+~ on Windows. The date turns into its serial number. Change the format back and the date reappears. Nothing about the value changed, only its appearance. This is the single most useful mental model for working with dates: the value is a number, the format is a costume.

Times follow the same logic. A day is 1, so an hour is 1/24 and noon is 0.5. A cell that shows 15 Dec 2025 12:00 contains 46006.5. You will use this heavily in the time-math labs later in the course, where the trick of multiplying by 24 turns a time difference into decimal hours.

A date is just a number of days11 Jan 1900…4600615 Dec 2025460231 Jan 2026460286 Jan 2026stored value (General format)what the date format shows=C3-B3 → 46028 − 46006 = 22T-1042 was open 22 days, across New Year
Figure 1. The value in the cell is a whole number; the date format only changes how it looks. That is why you can subtract one date from another and get the number of days between them.

Two historical quirks are worth knowing. First, Excel treats 1900 as a leap year and accepts 29 Feb 1900, a date that never existed, for compatibility with the old Lotus 1-2-3 spreadsheet. It only affects dates before 1 March 1900. Second, some older workbooks, particularly ones created on early versions of Excel for Mac, use the 1904 date system, where serial numbers are 1,462 lower. If dates shift by four years and one day when you copy between workbooks, check File > Options > Advanced > "Use 1904 date system".

Worked example: Kestrel’s service-ticket log

Kestrel logs every service ticket with the date it was opened and the date it was closed. Management wants to know how long tickets stay open, which year and month they belong to, and when the follow-up visit is due. The table below shows the eight tickets from the lab with the four calculated columns filled in.

TicketOpened (B)Closed (C)Days open (D)Year (E)Month (F)Follow-up (G)
T-104124 Nov 20253 Dec 202592025Nov1 Dec 2025
T-104215 Dec 20256 Jan 2026222025Dec1 Jan 2026
T-10438 Jan 20269 Jan 202612026Jan1 Feb 2026
T-104430 Jan 202612 Feb 2026132026Jan1 Feb 2026
T-104517 Feb 20262 Mar 2026132026Feb1 Mar 2026
T-10465 Mar 20265 Mar 202602026Mar1 Apr 2026
T-104721 Mar 20261 Apr 2026112026Mar1 Apr 2026
T-104814 Apr 202630 Apr 2026162026Apr1 May 2026

Days open. Because both dates are numbers, the formula is a plain subtraction: =C2-B2. For T-1042 that is 46028 − 46006 = 22 days. The ticket was opened before Christmas and closed after New Year, but that makes no difference to the arithmetic; Excel does not care about month or year boundaries when it subtracts. T-1046 was opened and closed on the same day, so it was open 0 days. If your organisation counts both the first and the last day, add 1, but be consistent and document the rule, because the lab and most service-level reports count the way shown here.

Year. =YEAR(B2) returns the year of the opening date as a plain number, such as 2025. The function ignores the format of the cell and reads the underlying serial number. That makes it perfect for grouping: a SUMIFS or a PivotTable on the year column instantly splits the log into 2025 and 2026 tickets. MONTH and DAY work in exactly the same way and return 1–12 and 1–31.

Month label. =TEXT(B2,"mmm") turns the opening date into a three-letter month name such as Nov or Dec. The second argument is a format code in double quotes, built from the same letters you use in custom number formats: d for day, m for month and y for year, repeated to make the output longer. The result is text. It looks perfect in a report heading, but Excel can no longer calculate with it or sort it chronologically, because as text, Apr comes before Jan.

Format codeShowsFormat codeShows
d5m3
dd05mm03
dddThummmMar
ddddThursdaymmmmMarch
yy26yyyy2026
mmm yyyyMar 2026dd/mm/yyyy05/03/2026

Follow-up visit. The rule is "the first day of the month after the ticket was opened". The robust formula is =DATE(YEAR(B2),MONTH(B2)+1,1). It takes the opening date apart, adds one to the month, sets the day to 1 and builds a new date. The clever part is what happens in December. For T-1042, opened on 15 Dec 2025, the formula asks for DATE(2025,13,1). Month 13 does not exist, so Excel rolls it over into January of the following year and returns 1 Jan 2026. You never need a special case for the end of the year.

CellFormulaResult for T-1042 (row 3)
D3=C3-B322
E3=YEAR(B3)2025
F3=TEXT(B3,"mmm")Dec (text)
G3=DATE(YEAR(B3),MONTH(B3)+1,1)1 Jan 2026
G3 (alternative)=EOMONTH(B3,0)+11 Jan 2026
spare cell=TEXT(B3,"ddd d mmm yyyy")Mon 15 Dec 2025 (text)

Why DATE is safe in DecemberB3 opened15 Dec 2025serial 46006Take it apartYEAR(B3) = 2025MONTH(B3)+1 = 13Build it againDATE(2025, 13, 1)month 13 rolls overResult in G31 Jan 2026 (serial 46023)Not robust: =B3+3014 Jan 2026, not the 1st of a monthDATE also rolls over days: DATE(2026,1,32) = 1 Feb 2026, DATE(2026,3,0) = 28 Feb 2026.Same result, different route: =EOMONTH(B3,0)+1
Figure 3. DATE accepts out-of-range months and days and rolls them into the next valid date. That turns "first day of next month" into one formula that works in every month, December included.

Formatting a date versus converting it to text

There are two ways to make a date look different, and choosing the right one saves trouble later. A number format changes only the appearance: select the cells, press Ctrl+1, choose Custom and type a code such as mmm yyyy. The cell still holds the serial number, so it still sorts in date order, still works in SUMIFS and still feeds charts correctly. The TEXT function creates a new value that is text. It is the right tool when the date has to become part of a sentence or a label, such as a report title or a key that joins a date to other text.

A simple rule of thumb: if you only want the cell to look like "Dec 2025", use a custom number format; if you need the words "Dec 2025" inside another piece of text, use TEXT. In the lab, the month column uses TEXT on purpose, because the task is to create a label. In your own reports, consider keeping a real date column for sorting and calculations next to any TEXT label column, so you never have to choose between a readable report and a correct one.

The same thinking applies to the year. =YEAR(B2) returns the number 2025, which you can compare, add to and group by. =TEXT(B2,"yyyy") returns the text "2025", which looks identical but will not match the number 2025 in a lookup. When a formula that compares years mysteriously fails, a number-versus-text mismatch is the first thing to check.

How to do it in Excel, step by step

  1. Check that your dates really are dates. Click a cell in the Opened column and look at the formula bar, then press Ctrl+Shift+~ to switch to General. If you see a five-digit number, it is a real date. If nothing changes, the "date" is text and must be converted first (see the mistakes section below). Undo with Ctrl+Z.
  2. In D2, type =C2-B2 and press Enter. If the result looks like a date in January 1900, the cell inherited a date format: press Ctrl+Shift+~ or choose Home > Number Format > General or Number.
  3. Fill the formula down to D9 by double-clicking the fill handle, the small square at the bottom-right corner of the selected cell.
  4. In E2, type =YEAR(B2), press Enter and fill down. Again, if the year appears as a date such as 17 Jul 1905, set the format to General.
  5. In F2, type =TEXT(B2,"mmm") and fill down. Note that the result is left-aligned: that is the sign of a text value.
  6. In G2, type =DATE(YEAR(B2),MONTH(B2)+1,1) and fill down. Format G2:G9 as a date with Ctrl+1 (Cmd+1 on Mac) > Number > Date, or choose a custom code such as d mmm yyyy.
  7. Check the edge case: T-1042 was opened in December, so G3 must show 1 Jan 2026, and E3 must still show 2025, because the year belongs to the opening date.
  8. Optional: build a report heading with ="Tickets opened in "&TEXT(B2,"mmmm yyyy"), which returns "Tickets opened in November 2025".
Ctrl+; types today’s date as a fixed value, which is ideal for logging when something happened. =TODAY() returns today’s date as a formula that updates every day, which is ideal for "days open so far" on tickets that are still open: =TODAY()-B2.

How long each ticket was open (=C2-B2)NovDecJan 26FebMarAprMayT-10419 dT-104222 dT-10431 dT-104413 dT-104513 dT-10460 dT-104711 dT-104816 d
Figure 2. The eight tickets from the lab on a calendar. T-1042 is the longest at 22 days and spans New Year; T-1046 was opened and closed on the same day, so it was open 0 days. Bars of 14 days or more are shown in peach.

Reading the results

Laid out on a calendar, the log tells a story the raw numbers hide. Most tickets close within about two weeks, but T-1042, the one that ran across the holiday period, took 22 days, and T-1048 took 16. A manager looking at this chart would ask whether the holiday period needs extra cover. That question only becomes visible once the dates have been turned into durations, which is exactly what the subtraction in column D does.

Excel dates and times course: serial dates, EOMONTH, NETWORKDAYS, time math and schedules
Every lab of this course uses the records of one fictional company, Kestrel Facility Services, from service tickets to timesheets and a project schedule.

Common mistakes and how to spot them

  • Dates stored as text. Imported dates are often text that only looks like a date. Signs: they are left-aligned, switching to General changes nothing, and =ISNUMBER(B2) returns FALSE. Fix them with Data > Text to Columns > Finish (choose the right date order in step 3), or with =DATEVALUE(B2) in a helper column.
  • Day and month swapped. 03/04/2026 is 3 April in most of Europe and 4 March in the United States. Excel reads typed dates according to the regional settings of the computer. Check a date with a day above 12: if 13/04/2026 stays as text, the order is wrong.
  • Result formatted as a date. =C2-B2 showing "9 Jan 1900" is not wrong; it is 9 days wearing a date format. Change the format to General.
  • Calculating with TEXT results. =TEXT(B2,"mmm") returns text. Sorting by it gives alphabetical order (Apr, Dec, Feb …). Keep the real date or MONTH(B2) for sorting and grouping; use TEXT only for labels.
  • Adding 30 days instead of a month. =B2+30 is not "next month". From 31 January it lands in early March in a non-leap year. Use DATE, EDATE or EOMONTH when the rule is about calendar months.
  • Hidden times. A date imported with a time, such as 46006.75, shows as 15 Dec 2025 but does not equal a typed 15 Dec 2025. Strip the time with =INT(B2) before comparing or looking up.
  • TEXT codes in other languages. The format codes in TEXT depend on the language of Excel. A workbook written with "yyyy" may need a different code in a localised version. If a TEXT result shows the code letters literally, check the language settings.

Quick reference: functions and shortcuts used

Function / shortcutSyntax or keysWhat it does
DATEDATE(year, month, day)Builds a date from numbers, rolling over out-of-range months and days
YEAR / MONTH / DAYYEAR(date), MONTH(date), DAY(date)Take a date apart into plain numbers
TEXTTEXT(value, "mmm yyyy")Turns a date into a text label in any format
EOMONTHEOMONTH(start_date, months)Last day of a month; +1 gives the first day of the next
TODAY / NOWTODAY(), NOW()Current date, or date and time, recalculated on every change
DATEVALUEDATEVALUE("15 Dec 2025")Converts a text date into a serial number
Insert today’s dateCtrl+; (semicolon)Types a fixed date that will not change tomorrow
Insert current timeCtrl+Shift+;Types a fixed time
Format CellsCtrl+1 (Cmd+1 on Mac)Choose a date format or a custom code
General formatCtrl+Shift+~ (Windows)Reveals the serial number behind a date

Real-world uses

  • Service and support desks. Days open per ticket, average resolution time per month and a list of tickets older than, for example, ten days with =TODAY()-B2>10.
  • Accounts receivable. Days between invoice date and payment date to measure how quickly customers pay, grouped by month with TEXT or by year with YEAR.
  • Contracts and subscriptions. The first billing date of the following month with =DATE(YEAR(A2),MONTH(A2)+1,1) for every new customer, regardless of the day they signed.
  • HR records. Probation end dates, anniversaries and monthly headcount reports, where YEAR and MONTH turn a list of start dates into groups.
  • Reporting headers. Dynamic titles such as ="Sales report "&TEXT(EOMONTH(TODAY(),-1),"mmmm yyyy") that always name the previous month.

What you will build in the rest of this course

This first lab is free. The paid labs continue with Kestrel’s data and take you from simple date arithmetic to complete schedules, with every cell checked instantly by the Coach.

EDATE & EOMONTH: Renewals, Due Dates & Fiscal Periods. You calculate renewal dates, end-of-next-month invoice due dates, calendar quarter ends and the fiscal year for eight maintenance contracts, using the two functions built for whole-month steps.

NETWORKDAYS & WORKDAY with Holidays and Custom Weekends. You set service-level due dates that skip weekends and closure days, count the working days each job took, handle a Monday-to-Saturday crew with NETWORKDAYS.INTL and flag late jobs.

DATEDIF & YEARFRAC: Age, Tenure and Pro-Rata Amounts. You calculate age and length of service on a report date, write tenure as "years and months", convert it into decimal years and pay a pro-rata bonus.

WEEKDAY, WEEKNUM & ISOWEEKNUM: A Weekly Revenue Report. You give each job a weekday number, an ISO week number and the Monday its week starts on, then total revenue per week with SUMIFS.

Time Math: Hours Worked, Overnight Shifts, MOD & ×24. You calculate shift lengths that cross midnight, convert times into decimal paid hours, round them to the nearest quarter hour and display totals above 24 hours correctly.

Weekly Timesheet: Regular Hours, Overtime & Pay. You split a technician’s weekly hours into regular and overtime hours with MIN and MAX, calculate daily pay with an overtime factor and chart the week.

Project Schedule: WORKDAY Chains & a Gantt-Style Bar Chart. You schedule an HVAC retrofit project in which each task starts after the previous one ends, count calendar days per task and turn the plan into a Gantt-style bar chart.

Summary

Excel stores dates as serial numbers and shows them through a format. Subtract two dates to get the days between them, use YEAR, MONTH and DAY to take a date apart, DATE to build one, with automatic roll-over into the next month or year, and TEXT to turn a date into a readable label when you no longer need to calculate with it. Check that imported dates are real numbers before you start, and most date problems never happen.

Now scroll back up and try it in the free lab: count the days each Kestrel ticket was open, extract the year, label the month and schedule the follow-up visits. The Coach checks every answer instantly, including the tricky December ticket.

Frequently asked questions

How does Excel store dates?

Excel stores a date as a serial number, the count of days since 1 January 1900, which is day 1. For example, 1 January 2026 is 46023. The date format only controls how that number is displayed.

How do I calculate the number of days between two dates in Excel?

Subtract the earlier date from the later one, for example =C2-B2. If the result looks like a date, change the cell format to General or Number.

Why does my date show as a five-digit number?

The cell has a General or Number format, so Excel shows the serial number behind the date. Apply a date format with Ctrl+1 to display it as a date again.

How do I get the month name from a date in Excel?

Use TEXT with a month code: =TEXT(B2,"mmm") returns Mar and =TEXT(B2,"mmmm") returns March. The result is text, so use MONTH(B2) when you need a number to sort or calculate.

How do I get the first day of next month in Excel?

Use =DATE(YEAR(B2),MONTH(B2)+1,1) or =EOMONTH(B2,0)+1. Both work in December too, because Excel rolls month 13 over into January of the next year.

Why is my date not recognised as a date in Excel?

It is probably stored as text, often after an import or because the day and month order does not match your regional settings. Convert it with Data > Text to Columns or with DATEVALUE in a helper column.

Keep going: Excel Dates & Times: DATE, EOMONTH, NETWORKDAYS, Time Math & Schedules

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.

  1. EDATE & EOMONTH: Renewals, Due Dates & Fiscal Periods
  2. NETWORKDAYS & WORKDAY with Holidays and Custom Weekends
  3. DATEDIF & YEARFRAC: Age, Tenure and Pro-Rata Amounts
  4. WEEKDAY, WEEKNUM & ISOWEEKNUM: A Weekly Revenue Report
  5. Time Math: Hours Worked, Overnight Shifts, MOD & ×24
  6. Weekly Timesheet: Regular Hours, Overtime & Pay
  7. Project Schedule: WORKDAY Chains & a Gantt-Style Bar Chart
  8. Imported Dates: Turning yyyymmdd Numbers and dd.mm.yyyy Text into Real Dates
  9. Date-Time Stamps: INT, HOUR & Response Times in Hours
  10. Business-Hours Elapsed Time: Counting Only Opening Hours Between Two Timestamps
  11. Recurring Dates: the 2nd Tuesday, the Last Friday & Paydays That Move Before Weekends
  12. Annual Inspections: Next Anniversary Date, Days Until & Booking Flags
  13. Period Totals with Date Criteria: Month-to-Date, Last Month & Same Period Last Year
  14. Turnaround Times: Days to Close, Median vs Average & a Histogram
  15. Date Quality Checks: Text Dates, End Before Start, Future and Weekend Entries
  16. Route Timing: Arrival Chains with TIME, Customer Windows & the Return to Depot
  17. Billing Call-Outs: Rounding Up to 15 Minutes, Minimum Charges & After-Hours Rates
  18. Monthly Capacity: Workdays per Month, Leave, Available Hours & Utilisation
  19. Final Project: Service Contract Date Dashboard with Renewal Status & Chart

Buy course — $9.90 See the full course