To change a date to a custom format in Excel for Microsoft 365 on Windows, select the date cells, press Ctrl+1, choose Number > Custom, enter a format code such as dd-mmm-yyyy, and select OK. This changes how the date appears, not the date value stored in the cell. Make sure the cells contain real Excel dates before you begin; text that merely looks like a date may need converting first.
What You’ll Need
- An Excel workbook with dates in cells. If you are starting from text or imported data, see the troubleshooting section before applying a format.
- Excel for Microsoft 365 on Windows for the exact steps below. Excel for Mac has a similar Format Cells dialog; Excel for the web may have fewer options for creating custom formats.
- The display style you want, such as 8 March 2025, 08-Mar-2025, or 2025-03-08. The format code determines the appearance.
Step-by-Step
- Select the date cells. Click one date cell, or drag over a range to select several. To format an entire column, click its column letter, but avoid doing this if the column also contains labels or other values that should not use date formatting. You can hold Ctrl while selecting separate ranges on Windows if the dates are in more than one place.
- Open Format Cells. Press Ctrl+1 on Windows. Alternatively, right-click the selection and choose Format Cells, or use the small dialog launcher in the Home tab’s Number group. On a Mac, select the cells and press Command+1, or choose Format > Cells. Keyboard settings can affect shortcuts, so use the menu if the shortcut does not open the dialog.
- Go to the Custom category. In the Format Cells dialog, open the Number tab and select Custom in the Category list. The Type box shows a code for the selected cell’s current format. You can edit that code or replace it entirely. The examples above the list show how Excel will display the selected value.
- Enter a date format code. Type the code you want in the Type box. For example,
dd-mmm-yyyydisplays a date like 08-Mar-2025;mmmm d, yyyydisplays March 8, 2025; andyyyy-mm-dddisplays 2025-03-08. Use the letter combinations below to build another style. Excel’s preview updates to show the effect on the selected cell. - Apply the format. Select OK. Check a few cells in the range to confirm the dates are readable and the year is visible where needed. If the cells show a row of hash marks, the column may simply be too narrow; widen it before deciding that the format failed.
- Save the workbook. Save as an Excel workbook, such as an .xlsx file, if you need the custom formatting to remain available. Custom formats you create are generally stored with the workbook, rather than added permanently to every workbook on your computer.
Use these code elements to make a format. d shows the day without a leading zero, and dd adds one. ddd gives an abbreviated weekday, while dddd gives the full weekday name. For months, m or mm shows a number, mmm gives an abbreviated month name, and mmmm gives the full month name. For years, yy shows two digits and yyyy shows four. For example, ddd, mmm d, yyyy could display Sat, Mar 8, 2025.
Excel interprets these letters as format instructions, not as text to print. To include a word or punctuation literally, put the text in double quotation marks inside the Type code. For example, mmmm d, yyyy "at noon" displays a date followed by at noon. The quotation marks are part of the format code and are not displayed. You can also use separators such as hyphens, slashes, commas, or spaces to separate date parts.
Common Mistakes
- Using the wrong month or minute code. The letter
mcan mean month or minute depending on its position. In a date-only pattern such ashh:mm, it represents minutes; inmm/dd/yyyy, it represents the month. When building a time-and-date format, Excel uses nearby hour or second codes to interpret minutes. If the result is unexpected, use a standard date format as a starting point and adjust one part at a time. - Typing a format that shows the wrong year length.
yydisplays only the final two digits of a year, which can be unclear in records that span decades. Useyyyyfor a four-digit year when the full date matters. - Expecting the format to change the underlying date. A display code does not move a date, change its value, or convert it into a different calendar date. Other cells and formulas still use the stored date value. If you need a different actual date, change the cell value rather than its number format.
- Applying formatting to text. If an entry is stored as text, changing its number format often has no visible effect. A value aligned to the left may be a clue, but alignment alone is not proof because cells can be aligned manually. Check whether Excel recognizes it as a date before troubleshooting the code.
- Editing a built-in format and expecting it to be universal. Custom formats created in a workbook usually travel with that workbook. If you open a different file, the custom code may not appear in its list. Apply or recreate it in the other workbook as needed.
Tips
- Keep an unambiguous year-month-day style for data exchange.
yyyy-mm-ddis easy to scan and reduces confusion between day-first and month-first formats. It affects display only; it does not by itself change how an external system interprets the date. - Show a weekday without replacing the date. Add
dddorddddto the code, such asdddd, mmmm d, yyyy. This adds the weekday as part of the display while keeping the cell’s value usable for date calculations. - Use a leading zero when consistent column widths matter.
dd/mm/yyyykeeps single-digit days two characters wide. Likewise,mmkeeps single-digit months padded. This can make a column easier to compare visually. - Format the whole relevant range at once. Select all date cells in a table before opening Format Cells to apply the same custom code consistently. If new rows are added later, check whether the table or copied row carries the format forward.
- Remember that display and export are different. An .xlsx workbook preserves number formats, but saving as CSV stores plain text values and does not preserve Excel’s cell formatting as a reusable custom format. Check the exported file if another system depends on an exact date representation.
Troubleshooting
The cell still shows the original entry after I apply the code. It may be text rather than an Excel date. Try selecting the cells and opening Data > Text to Columns. In the wizard, choose Delimited, select Next twice, then under Column data format choose Date and the order that matches the source, such as MDY or DMY. Select Finish, then apply the custom format. Do this only when you know the order of the source dates; interpreting 04/05/2025 as April 5 or May 4 incorrectly changes the intended date.
The displayed date is wrong by several months or years. Check the source date order and the workbook’s regional settings before converting text. For example, an imported day-first date can be read as month-first. Undo the conversion if possible, then repeat it with the correct date order. If the cell was already a real date, changing the display code cannot fix an incorrectly entered value.
I see hash marks instead of a date. Excel often displays ##### when the column is too narrow to show the formatted value. Widen the column by dragging the boundary between its column headings, or double-click that boundary to AutoFit. If widening does not help, check that the cell does not contain a negative date or another value that the chosen date system cannot display.
The Type code is rejected or looks different after I enter it. Check for missing characters, unbalanced quotation marks around literal text, or a format element that Excel does not recognize. Start with a simple code such as dd-mmm-yyyy, confirm it works, then add weekday names or literal words gradually. Date separators and month names can also display differently under different regional settings.
I cannot find Custom in Excel for the web. Select the cells and inspect the number-format options on the Home tab. Depending on the available controls, you may be able to choose or enter a custom format there. If the custom Type box is unavailable, open the workbook in the desktop Excel app and follow the Windows or Mac steps above. Reopen the workbook online afterward to check its appearance.
Frequently Asked Questions
Does changing a custom date format change the date itself?
No. It changes the way Excel displays the date. The cell remains a date value, so it can still be sorted, filtered, and used in date calculations.
Can I make Excel show the month name instead of a number?
Yes. Use mmm for an abbreviated month name, such as Mar, or mmmm for the full name, such as March. Combine it with day and year codes to keep the full date visible.
How do I show a date like 2025-03-08?
Open Format Cells, choose Number > Custom, enter yyyy-mm-dd in Type, and select OK. This controls the display; it does not convert text into a date.
Can I use a custom date format in Excel for Mac?
Yes. Select the cells, open Format > Cells or press Command+1, then use the Number tab and Custom category. The dialog may look different from Windows, but the date-code approach is similar.
Will my custom format remain when I send the workbook?
It should remain when you share an .xlsx workbook, although the recipient’s regional settings can affect how some separators or month names appear. A CSV file does not preserve Excel’s custom cell formatting, so inspect the exported text if the exact output matters.
Related
- How to Make Every Other Line a Color in Excel Quickly
- How to Make Every Other Row a Color in Excel (2 Ways)
- Automatic Borders in Excel: How to Apply Them as You Type
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Create Inbox Rules in Outlook on Windows and WebTo create an inbox rule in Outlook, open the rules settings, choose a condition such as who sent…
- Wrap Text in a Google Sheets Column: A Step-by-Step GuideTo wrap text in a Google Sheets column, select the column by clicking its letter, then choose Format…
- Excel Conditional Formatting: Add Color to Cells by RuleTo add color conditional formatting in Excel for Microsoft 365 on Windows, select the cells, then choose Home…
- Create Labels in Word From Excel: A Step-by-Step GuideIn Word for Microsoft 365 on Windows, create labels from an Excel list by choosing Mailings > Start…
- Excel Find and Replace Blanks: How to Fill or ClearTo fill genuinely empty cells in Excel, select the range, choose Home > Find & Select > Go…
- Outlook Group Mailbox Rules: What You Can and Can’t DoTo create a rule for a mailbox in Outlook, first check whether it is a shared mailbox or…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.