Change Date Format in Excel with Formula
This guide shows you how to change the display of dates in Excel using formulas, turning raw date serial numbers into any format you need—like “15 Mar 2025” instead of “03/15/2025”. You’ll learn the TEXT function for full control, plus DATEVALUE and other tricks for converting text dates into real dates. No prior formula experience is needed, just a spreadsheet with dates you want to reformat.
What You’ll Need
- Microsoft Excel (2010 or later; the steps work the same in Excel for Microsoft 365, Excel 2021, 2019, 2016, and Google Sheets with minor differences).
- A column or cell containing dates, either as real Excel dates (right-aligned by default) or as text (left-aligned).
- Basic familiarity with typing formulas in a cell (starting with =).
Step-by-Step
- Identify your date cells. Check if your dates are actual Excel dates (numbers) or text. Real dates align right; text dates align left. If they are text, skip to Step 5 for conversion.
- Choose a blank cell for the new format. For example, if your date is in A2, put the formula in B2. This keeps your original data intact.
- Use the TEXT function to format the date. Type:
=TEXT(A2, "dd-mmm-yyyy"). Press Enter. The result shows the date as 15-Mar-2025. The first argument is the date cell; the second is the format code in quotes. - Adjust the format code to your preference. Common codes:
"dd/mm/yyyy"gives 15/03/2025;"mmmm d, yyyy"gives March 15, 2025;"ddd"gives Fri (day abbreviation);"dddd"gives Friday. You can combine text with the date, like"Today is dddd". - If your dates are text, convert them first. Use DATEVALUE to turn text into a real date:
=DATEVALUE("15 March 2025")returns the serial number for that date. Then format it with TEXT as in Step 3, or simply apply a number format to the cell. For text in a cell like A2:=TEXT(DATEVALUE(A2), "dd/mm/yyyy"). - Copy the formula down. Select the cell with the formula, double-click the fill handle (small square at bottom-right) to fill the column, or drag it down manually.
- Convert the formula result to static text (optional). If you don’t want the formula to recalculate, copy the cells with the formula, right-click, and choose Paste Special → Values. This replaces the formula with the text result.
Common Mistakes
- Using the wrong format code. Excel is case-sensitive:
"mm"is month,"MM"is not recognized (it will show as literal text). Always use lowercasemmfor minutes and months, but note that"mm"in a date context is month. - Forgetting the quotes. The format code must be inside double quotes.
=TEXT(A2, dd/mm/yyyy)will give a #NAME? error. - Applying TEXT to a cell that already has a formula. TEXT returns text, so you cannot use the result in further date calculations. If you need to do math (e.g., add days), keep the original date and use a custom number format instead.
- Using DATEVALUE on a date that Excel doesn’t recognize. DATEVALUE only works with dates that Excel can parse; if the text is ambiguous (e.g., “03/04/05”), it may interpret it differently depending on your locale.
Tips
- Use custom number formats for display-only changes. If you don’t need the result as text, select the cells, press Ctrl+1, go to Number tab → Custom, and type your format code (e.g., dd-mmm-yyyy) in the Type box. This keeps the date as a real date, so you can still use it in calculations.
- Combine TEXT with other functions. For example, to show the day of the week and the date:
=TEXT(A2, "dddd, mmmm d")returns “Friday, March 15”. - Use the DATE function to build dates from parts. If you have year, month, day in separate columns, use
=DATE(year, month, day)then format it with TEXT or a number format. - For ISO week numbers or quarters, use WEEKNUM and ROUNDUP. Example:
="Q"&ROUNDUP(MONTH(A2)/3,0)gives Q1 for Jan-Mar.
Troubleshooting
- Formula returns #VALUE!. This usually means the date is text that Excel cannot interpret. Check the cell for extra spaces or non-breaking characters. Use TRIM to clean:
=TEXT(DATEVALUE(TRIM(A2)), "dd/mm/yyyy"). - Result shows a number like 45678. That’s the date serial number. You likely forgot the TEXT function or used a number format that doesn’t display as a date. Apply the TEXT function or change the cell format to Date.
- The date appears as ########. The column is too narrow to display the formatted date. Widen the column or adjust the format code to something shorter.
- Dates shift by a day or show wrong day. This can happen if the text date is ambiguous (e.g., “03/04/2025” could be March 4 or April 3). Use DATEVALUE with a clear text format like “4 March 2025” or use the DATE function with explicit year, month, day.
- Formula works in one cell but not when copied down. Check that the reference is relative (A2) not absolute ($A$2). If you used absolute, it will always refer to the first date.
Frequently Asked Questions
How do I change the date format without a formula?
Select the cells, press Ctrl+1, go to Number tab, choose Date, and pick a format from the list or create a custom one. This changes the display only; the underlying value stays a date.
Can I convert a text date to a real date?
Yes, use DATEVALUE(text) to get the serial number, then format the cell as a date. For example, if A1 has “15 March 2025”, type =DATEVALUE(A1) and format the result as a date.
Why does my TEXT formula return a time instead of a date?
If your cell contains a time value (like 0.5 for noon), TEXT will format it as a time. Ensure the cell contains a date serial number (integer part) or use the DATE function to isolate the date.
How do I show the month name in full?
Use "mmmm" for full month name (e.g., March) or "mmm" for abbreviated (Mar). Example: =TEXT(A2,"mmmm").
Can I use TEXT to add leading zeros to a month or day?
Yes, use "mm" for month and "dd" for day. For example, =TEXT(A2,"dd/mm/yyyy") gives 05/03/2025.
Does TEXT work in Google Sheets?
Yes, the TEXT function works similarly in Google Sheets, but the format codes are slightly different (e.g., use “yyyy” not “yyyy”). Check the Sheets documentation for differences.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.