# How to Convert Date to Number in Excel (4 Methods)

Get FREE Advanced Excel Exercises with Solutions!

In many situations, we need to convert a date to a number in Excel to accomplish a calculation. Working with date and time values is one of the trickiest parts of Excel. People store dates in different formats as the combination of day, month, and year. But what Excel does do to recognize a date? It stores dates as a number in the backend. In this article, weâ€™ll get to know the methods that transform a date into a number.

## 1. Converting the Date to a Serial Number in Excel with the DATEVALUE FunctionÂ

We will convert a date to a number in Excel. Here is an overview of the final result.

NOTE: As we know Excel stores dates as serial numbers in its system. This serial number starts from 1 on the date 1/1/1900 and increases by 1 onwards.

The DATEVALUE functionÂ in Excel converts a text-formatted date to a serial number that is recognizable as a date to Excel.

Syntax of the DATEVALUE function:

=DATEVALUE (date_text)
where date_text is the only argument.

### #Example 1: DATEVALUE Function ArgumentÂ in the Date Format

If the argument for the DATEVALUE function is in the date format, then we need to put the date inside double quotes to make the function work. See the screenshots below:

Screenshot 1: We can see that the selected column is in the date format.

Screenshot 2: We put the date inside a double quote to make it text for the DATEVALUE function and then hit ENTER.

The DATEVALUE function converted the date into a serial number.

### #Example 2: DATEVALUE Function ArgumentÂ in the Text Format

If the argument for the DATEVALUE function is in the Text format, then we just need to put the date inside the function to transform it into a serial number. Letâ€™s follow the screenshots:

Screenshot 1: Here the selected cells contained a list of dates in Text format.

Screenshot 2: Here in cell H6, we put F6 as the argument which contains the date 1/1/2022 (in Date format), and hit Enter to convert it to a serial number.

## 2. Converting Date to a Serial Number Changing the Formatting

In this method, weâ€™ll use the Home tab of the Excel ribbon to transform a date into a 5-digit serial number.

• This screenshot shows a list of dates in the Date format. From the Home tab, navigate to the Number section, there is a box that shows the format of the selected cells and options to change into another format.

• Now from the format options choose the General or the Number option.

• The above step will turn the date into a 5-digit serial number.

Similarly, we can have all other dates converted into a serial number.

## 3. Using Format Cells Dialog Box for Converting Date to Number

Open the Cell Formatting Option (3 ways):

• The Context Menu in Excel provides the option of Cell Formatting named Format Cells. With the option of cell formatting, we can change the format for the selected cell. We can open the context menu by simply clicking the right button of our mouse on the selected cell.

• We can also go to the Cells section from the Home tab.
• From the Format tab, select the Format Cells option.

• Press Alt + H + O + E on your keyboard to make the Format Cells window visible.

Now you have the Format Cells window opened. In the Number tab, select General from the Category list. This time we selected all the cells that contain dates, together. Finally, donâ€™t forget to click the OK button.

## 4. Using Custom Formatting to Transform the Date to an 8-digit Number (mmddyyyy or ddmmyyyy Format)

By following the ways (click here to see the ways) described in the previous method, we can open the cell formatting options easily. Then follow the steps below:

• Go to the Number tab.
• Select the Custom option from the Category.
• Put mmddyyyy in the Type input box.
• Finally, click the OK button.

• The above steps converted all the dates into 8-digit numbers in the mmddyyyy format. We can see the first 2 digits represent the month, the following 2 digits represent the day, and the last 4 digits are the year.

Following the same procedure, we can have different formats like ddmmyyyy, yyyymmdd, etc.

Here is an overview:

Read More: How to Convert Date to Text YYYYMMDDÂ

## Things to Remember

• Sometimes it may happen while converting a date to a number, the result shows #### in the cell. It happens when the cell width is not enough to hold the serial numbers. Increasing the cell width will solve it immediately.
• While using the default date system of Microsoft Excel for Windows the argument value must be in a range from January 1, 1900,Â to December 31, 9999. It fails to handle a date beyond this range.

## Conclusion

Now, that we know the methods to convert a date to a number in Excel, it would encourage you to use this feature more confidently. Any questions or suggestions donâ€™t forget to put them in the comment box below.

## Related Articles

<< Go Back to Change Date Format | Date FormatÂ |Â Number FormatÂ |Â Learn Excel

## What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Al Arafat Siddique

Al Arafat Siddique, BSc, Naval Architecture and Marine Engineering, Bangladesh University of Engineering and Technology, has worked on the ExcelDemy project for two years. He has written over 85+ articles for ExcelDemy. Currently, he is working as a software developer. He is leading a team of six members to develop Microsoft Office Add-ins, extending Office applications to interact with office documents. Other assigned projects to his team include creating AI-based products and online conversion tools using the latest... Read Full Bio

We will be happy to hear your thoughts

Advanced Excel Exercises with Solutions PDF