Blog

Excel Date Showing as a Number? Convert Serial Dates

Why Excel shows dates as numbers like 46357, how date serial numbers work, and how to convert them back to dates in Excel and in code.

Diagram showing 46357 displayed in an Excel cell and how it turns back into the date 2026/12/01. 46357 is the number of days counted from December 30, 1899, and the decimal part .75 represents 6 PM.
Contents

You build a reminder with a formula like =A1&" deadline" using a cell that holds a due date, and Excel shows “46357 deadline”. Or you load data exported from Excel into Python and the date column is full of five-digit numbers such as 46357 and 46388. Nothing is broken in either case. Excel stores dates as numbers from the start and simply displays them in a date format most of the time.

This article first explains what that number (the serial number) is counting, then walks through how to turn it back into a date inside Excel and how to convert it in programs outside Excel. It also explains, from an old Excel design decision, why external conversions use December 30, 1899 as the starting point rather than December 31, 1899.

The numbers in this article were calculated with Python 3’s datetime, pandas 3.0.5, and Node.js, and the results of the cell formulas were checked by opening an .xlsx file in LibreOffice Calc 24.2. Statements about Excel itself are limited to what can be confirmed in Microsoft’s documentation.

A date is a running number where January 1, 1900 is 1

With the default setting in Excel for Windows (the 1900 date system), January 1, 1900 is 1, and each day adds 1. According to Microsoft, the serial number for July 5, 2011 is 40729. Date systems in Excel

Date Serial number
1900/03/01 61
1970/01/01 25569
2011/07/05 40729
2026/11/26 46352
2026/12/01 46357
2027/01/01 46388
9999/12/31 2958465

Times are stored in the fractional part. Because one day equals 1, 0.5 is noon and 0.75 is 6 PM. 46357.75 is December 1, 2026 at 18:00. Subtracting one date from another gives the number of days, and =A1+7 gives the date one week later, precisely because the value underneath is just a number.

When you see a number, first check whether the cell holds an integer (or decimal) of about five digits. Dates near today, roughly 2025 to 2027, fall in the range 45658 to 46752. If numbers in that range fill a column, they are almost certainly serial numbers.

Turning the display back into a date inside Excel

The cell format is “General” or “Number”

If you paste a date cell somewhere with “Paste Values”, or return a formula result into a column formatted as “General”, the date format is not carried over and you see the raw number. The value itself is correct, so changing the format brings the date back.

  1. Select the cell or column showing the number.
  2. Press Ctrl+1 to open Format Cells, and choose Date on the Number tab. For a format like 2026/12/1, choose Custom and enter yyyy/m/d (or m/d/yyyy, d/m/yyyy, whatever your readers expect).
  3. Click OK and confirm that 46357 has become 2026/12/1. To show the time as well, use yyyy/m/d h:mm.

Joining a date with text turns it into a number

When you join a cell with text using & or CONCAT, Excel converts the underlying number to text, not what the cell displays. That is why the opening example shows “46357 deadline”, and no change of cell format will fix it. To join a date as text, convert it to a date string first with the TEXT function.

=A1&" deadline"                        → 46357 deadline
=TEXT(A1,"yyyy-mm-dd")&" deadline"     → 2026-12-01 deadline
=TEXT(A1,"ddd, mmm d")&" deadline"     → Tue, Dec 1 deadline

ddd is the format code for an abbreviated weekday and dddd for the full name. In the Japanese edition of Excel, the code aaa shows the weekday in Japanese (月, 火, …), which is why you may see it in spreadsheets from Japan.

When dates are off by one day or by four years

If the value is not a number but the date is off by exactly 1,462 days (about four years), suspect the 1904 date system described below. If only dates before March 1900 are off by one day, it is the February 29, 1900 issue explained in the next section.

Converting to a date in programs other than Excel

When you read a CSV exported from Excel, or read cells still formatted as “General” from an .xlsx file, the program receives a number. If you treat it as “days since December 30, 1899”, every date from March 1, 1900 onward converts correctly.

In Python’s pandas, pass days as unit and the start date as origin to to_datetime.

import pandas as pd

s = pd.Series([46357, 46388, 46357.75])
print(pd.to_datetime(s, unit="D", origin="1899-12-30"))
# 0   2026-12-01 00:00:00
# 1   2027-01-01 00:00:00
# 2   2026-12-01 18:00:00

With only the standard library, datetime(1899, 12, 30) + timedelta(days=46357.75) gives the same result. In JavaScript, convert to milliseconds and add.

const serial = 46357.75;
const base = Date.UTC(1899, 11, 30); // months are 0-based, so 11 is December
const d = new Date(base + Math.round(serial * 86400000));
console.log(d.toISOString()); // 2026-12-01T18:00:00.000Z

This example treats both the starting point and the result as UTC so that no time zone offset sneaks in. A serial number carries no time zone information. A value entered in Excel as “18:00” only means 6 PM in whatever region the person who made the sheet was in, so read the Z in toISOString() as a time without an offset, and apply the region in your application if needed.

Why the starting point is December 30, not December 31, 1899

If January 1, 1900 is 1, then 0 should be December 31, 1899. External conversions still use December 30 because Excel treats 1900 as a leap year and assigns serial number 60 to February 29, 1900, a date that never existed.

1900 is divisible by 4, but it is also divisible by 100 and not by 400, so it is not a leap year in the Gregorian calendar. Microsoft describes this as “Excel incorrectly assumes that the year 1900 is a leap year”, and the behavior exists so that Excel numbers dates the same way as Lotus 1-2-3, the dominant spreadsheet at the time. Excel incorrectly assumes that the year 1900 is a leap year

As a result, from March 1, 1900 (61) onward, Excel’s serial numbers count one day more than the real calendar. Moving the starting point one day earlier, to December 30, 1899, makes every value from 61 up match the actual date. Conversely, values from 1 to 59 (January 1 to February 28, 1900) come out one day early with the December 30 origin, and 60 has nowhere to go because the date does not exist. You will rarely see this range in business data, but if you do, check whether blank cells were read in as 0 or other small numbers.

The 1904 date system shifts dates by about four years

Excel has a second system, the 1904 date system, which starts from January 1, 1904. According to Microsoft, older versions of Excel for Mac used it by default, while Excel for Windows, Excel 2016 for Mac, and Excel for Mac 2011 default to the 1900 date system. The same July 5, 2011 is 39267 in the 1904 date system. The gap between the two systems is 1,462 days (four years and one day). Date systems in Excel

Workbooks made on old Macs, and templates inherited from them, sometimes still have this setting turned on. If dates moved by four years when you pasted them into another workbook, or a program converted them to dates four years too early, check here:

  • Excel for Windows: File → Options → Advanced, under “When calculating this workbook”, the Use 1904 date system checkbox
  • When converting in a program: if the workbook uses the 1904 date system, set the origin to 1904-01-01

If you switch this setting in a workbook that already has data, the stored serial numbers stay the same and only the displayed dates move by four years. Change it only after confirming that this is really the cause of the shift.

Converting to and from UNIX time

Logs and APIs often record timestamps as UNIX time (seconds since 00:00 UTC on January 1, 1970). January 1, 1970 is serial number 25569, so you can convert by accounting for the difference between days and seconds.

Serial number → UNIX time (seconds)   =(A1-25569)*86400
UNIX time (seconds) → serial number   =A1/86400+25569

Applying the first formula to a cell containing 2026/12/01 gives 1796083200, and applying the second to 1798761600 and formatting the result as a date gives 2027/01/01 0:00. Note, however, that UNIX time is based on UTC while a serial number has no time zone. To record local time, add your offset after converting from UNIX time: for Japan Standard Time (UTC+9) that is +9/24 (nine hours), and for New York in winter (UTC−5) it is -5/24. When converting a local date and time to UNIX time, subtract the offset first.

To check that a converted value is right, paste the seconds into the UNIX time converter and compare the JST and UTC displays. The steps for reading log timestamps are covered in the article on reading Unix timestamps in JST and setting a log search start.

When something looks like a date but won’t calculate

The opposite problem also happens. A cell shows 2026/12/01, yet subtraction and sorting don’t work. In this case the value is stored as text, not as a serial number. If the format is still “General”, numbers and dates are right-aligned while text is left-aligned, which makes them easy to tell apart.

This often happens when opening a CSV or copying from another system. Select the column, go to Data → Text to Columns, and click through to Finish; Excel will usually reinterpret the values as dates. In a formula you can use the DATEVALUE function, but which date formats it accepts depends on Excel’s language and regional settings. A formula that converts 2026/12/1 on one computer may return an error on a computer with different regional settings, so be careful with workbooks you hand to other people.

Calculating the difference between dates, such as counting business days, is also covered in the article on counting business days over the New Year.

Steps to reproduce the numbers in this article

With Python 3 and pandas you can check the serial numbers in the table and the conversion results.

from datetime import date
base = date(1899, 12, 30)
for d in [date(1900, 3, 1), date(1970, 1, 1), date(2011, 7, 5),
          date(2026, 12, 1), date(9999, 12, 31)]:
    print(d, (d - base).days)
# 1900-03-01 61
# 1970-01-01 25569
# 2011-07-05 40729
# 2026-12-01 46357
# 9999-12-31 2958465

print((date(2011, 7, 5) - date(1904, 1, 1)).days)  # 39267 (1904 date system)
print((date(1904, 1, 1) - base).days)              # 1462 (gap between the two systems)

The formula results were checked by creating an .xlsx with openpyxl containing December 1, 2026 in A1, =A1&"締め切り" (“deadline”) in B1, =TEXT(A1,"yyyy/mm/dd")&"締め切り" in C1, and =(A1-25569)*86400 in F1, then recalculating it in LibreOffice Calc 24.2. B1 became 46357締め切り, C1 became 2026/12/01締め切り, and F1 became 1796083200.

An Excel date may look like a date, but underneath it is a running number. When you see a number, first check whether it is around 46000. Inside Excel, fix it with the cell format or the TEXT function; in an outside program, convert it from a December 30, 1899 origin. If dates are four years off, suspect the 1904 date system; if times are off by a few hours, suspect the time zone. With these three in mind, you can usually pin down why a date turned into a number.