Excel stores dates as serial numbers that represent the number of days since January 1, 1900. For example, the date January 1, 2021 is stored as the number 44197, because it is 44,197 days after January 1, 1900. Similarly, the date December 31, 2020 is stored as the number 44196, because it is one day less than January 1, 2021.
To turn a number into a date on Excel, we need to apply a date format to the cell that contains the number. This will tell Excel to display the number as a date, according to the chosen format. For example, if we apply the format mm/dd/yyyy
to the cell that contains the number 44197, Excel will display it as 01/01/2021
.
Procedures
To turn a number into a date on Excel, follow these steps:
- Select the cell or range of cells that contain the numbers you want to convert to dates.
- Right-click on the selected cells and choose
Format Cells
from the context menu. Alternatively, you can pressCtrl + 1
on your keyboard to open the Format Cells dialog box. - In the Format Cells dialog box, click on the
Number
tab and selectDate
from the Category list. - Choose the date format you want from the Type list. You can also customize the date format by using the symbols in the table below.
Symbol | Meaning | Example |
---|---|---|
d | Day of the month as a number | 1-31 |
dd | Day of the month as a number with a leading zero | 01-31 |
ddd | Day of the week as an abbreviation | Sun-Sat |
dddd | Day of the week as a full name | Sunday-Saturday |
m | Month of the year as a number | 1-12 |
mm | Month of the year as a number with a leading zero | 01-12 |
mmm | Month of the year as an abbreviation | Jan-Dec |
mmmm | Month of the year as a full name | January-December |
yy | Year as a two-digit number | 00-99 |
yyyy | Year as a four-digit number | 1900-9999 |
- Click
OK
to apply the date format to the selected cells.
Example
Let’s say we have a list of numbers in column A that represent the dates of some events. We want to turn these numbers into dates using the format mm/dd/yyyy
. Here is how the worksheet looks like before and after applying the date format:
A | B |
---|---|
44196 | |
44197 | |
44200 | |
44201 | |
44202 |
A | B |
---|---|
44196 | 12/31/2020 |
44197 | 01/01/2021 |
44200 | 01/04/2021 |
44201 | 01/05/2021 |
44202 | 01/06/2021 |
Other Approaches
Besides using the Format Cells dialog box, there are other ways to turn a number into a date on Excel. Here are some of them:
- Use the
DATE
function. TheDATE
function takes three arguments: year, month, and day, and returns a serial number that represents the date. For example,=DATE(2021,1,1)
returns 44197, which is the serial number for January 1, 2021. To display the serial number as a date, you need to apply a date format to the cell that contains the formula. - Use the
TEXT
function. TheTEXT
function takes two arguments: a value and a format code, and returns a text string that represents the value in the specified format. For example,=TEXT(44197,"mm/dd/yyyy")
returns01/01/2021
, which is a text string that represents the number 44197 in the date formatmm/dd/yyyy
. Note that the result of theTEXT
function is not a date, but a text. This means that you cannot perform date calculations or apply date filters on the result. - Use the
DATEVALUE
function. TheDATEVALUE
function takes one argument: a text string that represents a date, and returns a serial number that represents the date. For example,=DATEVALUE("01/01/2021")
returns 44197, which is the serial number for January 1, 2021. To display the serial number as a date, you need to apply a date format to the cell that contains the formula.