How to change the date format in Excel

Excel stores dates as numbers, so changing how they look on screen is separate from changing the actual data. You can format a single cell, a range of cells, or an entire column to display dates the way you need them — whether that's 12/25/2024, December 25, 2024, or 25-Dec-24. The formatting doesn't alter the underlying date value, so formulas and sorting still work correctly.

The fastest way is to select the cells with dates, right-click, choose Format Cells, click the Number tab, select Date from the category list on the left, and pick the format you want from the list. Click OK. If you don't see the exact format you need, you can create a custom one using date codes like YYYY for four-digit year, MM for month, and DD for day.

Key Takeaways

  • Select the cells containing dates, right-click, and choose Format Cells to open the formatting dialog.
  • Click the Number tab, select Date from the category list, and choose from the built-in formats shown.
  • If none of the built-in formats match what you need, select Custom and type a format code like YYYY-MM-DD or DD/MM/YYYY.
  • Changing the format only changes how the date appears on screen — the actual date value and any formulas using it remain unchanged.

Using the Format Cells dialog

Open your spreadsheet and click on a cell containing a date. If you need to format multiple cells at once, click the first one, hold Shift, and click the last one in the range. You can also click a column header to select the entire column.

Right-click on the selected cell or range and click Format Cells. The Format Cells dialog opens. Make sure you're on the Number tab — it's usually the default. On the left side under Category, click Date. The middle panel shows all available date formats for your current language and region. Click the one you want, and the preview pane on the right shows how it will look. Click OK when you've chosen.

Creating a custom date format

If the built-in formats don't include what you need, you can build your own. Open Format Cells the same way, go to the Number tab, and select Custom from the Category list on the left. The Type field at the top shows the code for the currently selected format.

Clear that field and type your own code. Common date codes are YYYY (four-digit year), YY (two-digit year), MM (month as number), MMM (month as three-letter abbreviation), MMMM (full month name), DD (day), and DDD (day name). Separate them with hyphens, slashes, or spaces — for example, DD/MM/YYYY produces 25/12/2024, while MMMM D, YYYY produces December 25, 2024. The preview updates as you type so you can see the result before you click OK.

Formatting dates in different Excel versions

The steps above work in Excel 2016, 2019, 2021, and Microsoft 365 on Windows. On a Mac, the process is identical: select cells, right-click (or Control-click), choose Format Cells, click Number, select Date, and pick your format.

In Excel Online (the free version in your web browser), right-click the selected cells and look for Format cells in the menu. Click it, then select Date from the category list. The available formats are the same, though the dialog layout is slightly different. If you don't see a Format Cells option, make sure you're in edit mode — click Edit Workbook at the top of the page first.

Why dates sometimes show as numbers or errors

If a cell shows a long number like 45627 instead of a date, the column is too narrow or the cell isn't formatted as a date. First, try widening the column by double-clicking the border between column headers. If that doesn't help, the cell contains a number that Excel doesn't recognize as a date. Select it, open Format Cells, choose Date, and click OK — Excel will convert it if it can.

If you see ##### symbols, the column is definitely too narrow. Position your cursor on the border between the column headers (for example, between A and B), and when it changes to a resize cursor, double-click to auto-fit the width. If a date shows as an error like #VALUE!, the cell contains text that looks like a date but isn't actually stored as one — you may need to re-enter it or use a formula to convert it.

Formatting dates when you paste data

When you paste dates from another source — an email, a website, or another program — they sometimes paste as text instead of dates. Excel won't recognize them as dates, so formatting won't work. To fix this, select the cells, go to the Data menu, and click Text to Columns. Click Next twice to skip the delimiter options, make sure Date is selected in the Column data format section, and click Finish. Excel converts them to real dates, and then you can format them normally.

Alternatively, if you know the dates are in a consistent format, you can use a formula to convert them. For example, if dates are pasted as text in the format "12/25/2024" in column A, you can type =DATEVALUE(A1) in column B to convert them to actual dates. Copy the formula down for all rows, then copy column B, paste it as values back into column A, and delete column B.

Frequently Asked Questions

Can I format dates differently in different cells of the same column?

Yes. Select only the cells you want to change — you don't have to select the whole column. Right-click, choose Format Cells, pick your format, and click OK. Only the selected cells change. Other cells in the same column keep their original format.

What if my dates are showing in the wrong year or century?

Excel interprets two-digit years between 00 and 29 as 2000–2029, and 30–99 as 1930–1999. If your dates are wrong, re-enter them with four-digit years, or use a formula like =DATE(YEAR(A1)+100,MONTH(A1),DAY(A1)) to add 100 years to dates that are off by a century. Then format the result as a date.

Does changing the date format affect how Excel sorts the dates?

No. Excel sorts by the actual date value stored in the cell, not by how it's displayed. Formatting only changes the appearance. If dates aren't sorting correctly, they're probably stored as text, not dates — use Text to Columns to convert them first.

Can I apply the same custom format to dates in the future?

Yes. Once you create a custom format, it appears in the Custom category in Format Cells for that workbook. If you want to use it in other workbooks, you can save it as a template or manually re-enter the format code in each new file.