Excel 圖表把日期顯示成數字(軸上的序列號)
2024 年 1 月 8 日的序列號是 45299。軸或源單元格若被設為數字或常規格式,就會看到這個數字而不是日期。在 Excel 中右鍵橫軸,開啟“設定座標軸格式”,將數字格式設為日期。Google Sheets 在圖表編輯器的自定義 > 橫軸中設定,或先把源列設為日期。
本文目錄
快速解答
2024 年 1 月 8 日的序列號是 45299。軸或源單元格若被設為數字或常規格式,就會看到這個數字而不是日期。在 Excel 中右鍵橫軸,開啟“設定座標軸格式”,將數字格式設為日期。Google Sheets 在圖表編輯器的自定義 > 橫軸中設定,或先把源列設為日期。
=DATE(2024,1,8)
=TEXT(DATE(2024,1,8),"yyyy-mm-dd")檢查重點
2026 年 11 月 12 日測試中,=DATE(2024,1,8) 為 45299,TEXT 得到 2024-01-08。把同一字串存為文本後,ISTEXT 為 TRUE,ISNUMBER 為 FALSE,DATEVALUE 仍為 45299。只改軸格式無法把文本變成日期軸,需先轉換源列。
邊界與相容性
若軸顯示 1、2、3,或日期被當成第二條很大的數值系列,多半是分類軸沒用日期列。在“選擇資料”中把日期設為橫軸標籤,把收入或數量設為系列。透視表圖表同樣可能繼承常規格式;若無法按月組合,先修好源日期。
完整英文範例、公式與作者備註
Excel How-toTested in: The serial,
TEXT, andDATEVALUEresults below were evaluated in Google Sheets on 12 November 2026. Excel 365 menu names are the current desktop labels; I did not click through Format Axis in Excel this session.
How to pick a line vs a column chart is in How to Make a Chart in Excel. This page is only about an axis that shows serials.
The number is the date
Excel and Google Sheets store a date as a whole number of days from a fixed origin. In the test workbook:
=DATE(2024,1,8)
=TEXT(DATE(2024,1,8),"yyyy-mm-dd")
The first formula is serial 45299 (that is what you see if the cell or the axis is formatted as a number). The second returned 2024-01-08. Nothing is “wrong” with 45299 except the format.
In Excel 365
- Click the chart, then right-click the horizontal axis.
- Choose Format Axis.
- Open the Number section (sometimes under Axis Options).
- Set the category to Date, or type a format code such as
yyyy-mm-ddord-mmm. - If the axis still shows 1, 2, 3, the chart is not using your date column as the category. Open Select Data and set the horizontal (category) labels to the date range.
In Google Sheets
- Click the chart, then open the chart editor.
- Under Customize > Horizontal axis, set a date number format if the option is there.
- If it is not, format the source date column as a date (Format > Number > Date) and, in Setup, confirm the date column is the X-axis.
When the source is text, not a serial
Formatting the axis does not fix labels that were typed as text. A cell can look like 2024-01-08 and still be text. In the test workbook I stored those characters as text in L4:
=ISTEXT(L4)
=ISNUMBER(L4)
=DATEVALUE(L4)
On 12 November 2026 those returned TRUE, FALSE, and 45299. DATEVALUE produced the same serial as =DATE(2024,1,8). Put that converted column on the axis, or paste the values over the text, then format the axis as a date.
If DATEVALUE returns #VALUE!, the text is not in a date order your locale expects. Use the conversions in dates stored as text. Mixed columns — some real dates, some text — produce an axis that looks partly numbered, partly labeled, and a line chart that treats the labels as unordered categories.
The axis used the wrong column
A second common cause is a chart built from the value column only. Excel then uses 1, 2, 3 as the axis, or it plots the dates as a second series of large numbers (45299 sits far above a revenue series of 7800). In Select Data, the date column should be the category axis, and the revenue (or quantity) column should be the series. Do not include both the date serial and the revenue as two series on the same value axis.
A pivot chart can show serials for the same reason: the date field is a number, and the chart inherited a General format. Format the axis, or group the pivot dates first so the axis shows month labels. If Group is disabled, fix the source as in cannot group dates in a pivot table.
Once the axis shows 8 Jan 2024 instead of 45299, check that the points are in date order. Text labels sort alphabetically; real dates sort as numbers, which is what you want on a time scale.