The DATEVALUE function in Excel converts a date that is stored as text (for example, "March 15, 2025" or "2025-03-15") into a serial number that Excel recognizes as a real date. This is essential when you import data from other systems, copy dates from emails, or receive spreadsheets where dates are left-aligned (text) instead of right-aligned (true dates). Once converted, you can sort, filter, calculate intervals, and use the dates in formulas. Before you start, ensure your computer's regional date settings match the format of your text dates, or the function may return a #VALUE! error.
What You'll Need
- Microsoft Excel (2010 or later, including Excel for Microsoft 365)
- A cell containing a date stored as text
- Basic familiarity with entering formulas in Excel
Step-by-Step
- Identify the text date. Look for a cell that has a date but is left-aligned by default. For example, cell A1 might contain "12/31/2025" or "December 31, 2025". If you click the cell, the formula bar shows the text as typed, not a date serial number.
- Choose an empty cell for the result. Click on a blank cell, say B1, where you want the real date to appear.
- Type the DATEVALUE formula. Enter
=DATEVALUE(A1)and press Enter. Replace A1 with the actual cell reference containing your text date. - Check the result. If the text was recognized, you will see a number (like 46022) or a date (depending on the cell format). If you see a number, that's the serial number—Excel stores dates as numbers. To display it as a date, proceed to the next step.
- Format the result as a date. Right-click the cell with the formula, choose Format Cells (or press Ctrl+1), go to the Number tab, select Date, and choose your preferred date format (e.g., MM/DD/YYYY). Click OK.
- Copy the formula down (if needed). If you have multiple text dates in column A, drag the fill handle (the small square at the bottom-right of the cell) down to apply the formula to other rows.
- Replace the original text with the real dates (optional). Select the cells with the formulas, press Ctrl+C, then right-click and choose Paste Special → Values. This replaces formulas with static dates. Then you can delete the original text column.
Common Mistakes
- Using the wrong cell reference – Double-check that the reference inside DATEVALUE points to the cell with the text date, not an empty cell or a cell with a real date.
- Ignoring regional date settings – DATEVALUE is locale-sensitive. If your system uses DD/MM/YYYY and your text is MM/DD/YYYY, the function may misinterpret the date or return an error.
- Forgetting to format the result – The function returns a serial number. If you don't format it as a date, you'll see a large number and think the formula failed.
- Applying DATEVALUE to a cell that already contains a real date – This will cause a #VALUE! error because DATEVALUE only works on text.
Tips
- Use TRIM to remove extra spaces: If your text has leading/trailing spaces, wrap it:
=DATEVALUE(TRIM(A1)). - Handle dates with time: DATEVALUE ignores time, so "3/15/2025 3:30 PM" will convert to just the date. Use
=VALUE(A1)if you need both date and time. - Convert text to dates without a formula: Select the text dates, go to Data → Text to Columns, click Next twice, choose Date under Column data format, and select the appropriate date order (MDY, DMY, etc.). This is a quick alternative.
- Use ISNUMBER to test: To check if a cell contains a real date, use
=ISNUMBER(A1)– returns TRUE for real dates, FALSE for text.
Troubleshooting
- #VALUE! error: This means the text is not recognized as a date. Check for: extra spaces (use TRIM), non-breaking spaces (use CLEAN), or an unrecognized format. Try changing the text to a standard format like "2025-03-15" or "15-Mar-2025".
- Wrong date returned (e.g., month and day swapped): Your system's date order (MDY vs DMY) is interpreting the text differently. Go to Windows Settings → Time & Language → Region, and adjust the short date format, or use the
DATEfunction to manually parse:=DATE(RIGHT(A1,4), MID(A1,4,2), LEFT(A1,2))for a text like "15/03/2025". - Result is a number, not a date: That's normal—just format the cell as a date (Step 5). If you want the date to appear immediately, set the cell format before entering the formula.
- DATEVALUE returns #VALUE! for dates with slashes that look fine: Try using the DATEVALUE function on a sample text in a new cell to isolate the issue. If it still fails, the text may contain hidden characters (like a non-breaking space from a web page). Use
=CLEAN(A1)to remove them.
Frequently Asked Questions
Can DATEVALUE convert dates with time?
No, DATEVALUE only extracts the date part. If you have "3/15/2025 3:30 PM", it will return the serial number for 3/15/2025, ignoring the time. For both, use =VALUE(A1) and format as date/time.
Why does DATEVALUE return #VALUE! for "March 15, 2025"?
This usually happens if the month name is abbreviated differently (e.g., "Mar" vs "March") or if there are extra spaces. Also, ensure your system's language supports the month name. Try using the full month name or switch to a numeric format.
How do I convert a column of text dates at once?
Enter the DATEVALUE formula in the first row, then double-click the fill handle to copy it down. Alternatively, use Text to Columns (Data tab) and select Date as the column format.
Is there a way to convert text dates without a formula?
Yes, use Text to Columns. Select the column, go to Data → Text to Columns, choose Delimited (or Fixed width), click Next, then in Step 3 choose Date and select the date order (MDY, DMY, YMD). Click Finish.
What is the serial number that DATEVALUE returns?
Excel stores dates as sequential numbers where 1 = January 1, 1900. For example, March 15, 2025 is serial number 45766. You can see this by formatting the result as a number.
Does DATEVALUE work with dates before 1900?
No, Excel's date system starts at January 1, 1900. Dates before that will return a #VALUE! error. For pre-1900 dates, you'll need to keep them as text or use a custom calendar system.