How to Convert Text to Dates Using the DATEVALUE Function in Excel

When you export a massive dataset from a legacy web application or a generic CSV file, Microsoft Excel will often fail to recognize dates correctly. It might see “October 15, 2024” or “15-Oct-24” and interpret it entirely as a raw string of text rather than a mathematical date. This completely breaks your ability to sort chronologically, filter by month, or calculate the number of days between two cells. To instantly force Excel to convert dead text strings into fully functional serial numbers, you must use the DATEVALUE function.

How Excel Handles Dates

Before you can use the function, you must understand how Excel physically processes time. Excel does not actually see “January 1, 2024.” It sees the raw number 45292 (because it counts the exact number of days that have elapsed since January 1, 1900). If a cell contains the word “January”, Excel cannot perform math on it. The DATEVALUE function acts as a translator, reading the human text and outputting the underlying mathematical serial number.

Using the DATEVALUE Function

The syntax for this function is incredibly simple. It requires only one argument: =DATEVALUE(date_text)

Imagine cell A2 contains the stubbornly unformatted text string “2024/10/15”.

  1. Click into an empty cell (e.g., B2).
  2. Type the formula: =DATEVALUE(A2)
  3. Press Enter.

Excel will instantly read the text string in A2, recognize it as October 15th, and output the raw serial number (e.g., 45580) into cell B2.

Formatting the Serial Number

Because the DATEVALUE function exclusively outputs the raw mathematical serial number, cell B2 will look like a completely random string of digits to a human reader. You must apply a visual format shell over the number to make it readable.

Click on cell B2, navigate to the Home tab on the Excel ribbon, and look at the “Number” formatting drop-down menu (which probably says “General”). Click the menu and select Short Date or Long Date. The raw serial number will instantly transform into a perfectly formatted, fully functional date that you can now sort, filter, and use in complex mathematical formulas.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.