keepcalculator

06 Numbers and Powers

Custom Date Format: Step-by-Step Guide

Card No. 06·1369 · Updated · Standard formula, shown below

This guide shows you how to create a custom date format in spreadsheet software like Microsoft Excel, Google Sheets, or Apple Numbers. You’ll learn how to display dates exactly the way you want—such as “2025-03-14� or “Fri, Mar 14�—by combining year, month, day, and weekday codes. No special tools are needed; just a spreadsheet and a few minutes.

What You’ll Need

  • A computer or mobile device with a spreadsheet application (Excel, Google Sheets, Numbers, or similar).
  • A cell containing a date (or a list of dates) you want to reformat.
  • Basic familiarity with the application’s menu or toolbar.

Step-by-Step

  1. Select the cell(s) with the date. Click or tap the cell that contains the date you want to format. To apply the format to multiple cells, drag to select them all.
  2. Open the Format Cells dialog. In Excel, right-click the selected cells and choose “Format Cells� (or press Ctrl+1 on Windows, Cmd+1 on Mac). In Google Sheets, go to the menu “Format� → “Number� → “Custom date and time.� In Numbers, select “Format� → “Cell� from the menu, then click the “Data Format� pop-up and choose “Date & Time.�
  3. Choose “Custom� or “More formats.� In Excel, select “Custom� in the Category list. In Google Sheets, you’ll see a text field where you can type a custom format. In Numbers, choose “Custom� from the date format options.
  4. Enter your date format code. Use the codes below to build your format. For example, to show “2025-03-14�, type yyyy-mm-dd. To show “Fri, Mar 14�, type ddd, mmm d. The codes are case-sensitive—pay attention to uppercase vs. lowercase.
  5. Preview the result. Most apps show a live preview of how the date will look. If it doesn’t look right, double-check your codes and adjust.
  6. Apply the format. Click “OK� or “Apply� to close the dialog. The selected cells will now display the date in your custom format.
  7. Save your work. The format is saved with the file. If you want to reuse it later, consider saving a template or noting the code.

Common Mistakes

  • Using the wrong case: mm means minutes, not months. Months are mm (lowercase) in Excel, but in Google Sheets, mm is minutes and mm for months is actually mm? No—in Google Sheets, mm is minutes, and months are mm? Actually, in Google Sheets, months are mm as well, but it’s safer to use mm for months and mm for minutes? Let’s clarify: In Excel, mm is minutes, mm is months? No, Excel uses mm for months and mm for minutes? Actually, Excel uses mm for months and mm for minutes? Wait, I need to be precise. In Excel, m is month, mm is month number, mmm is month abbreviation, mmmm is full month name. Minutes are mm only when used with hours. In Google Sheets, mm is minutes, and months are mm? No, Google Sheets uses mm for minutes and mm for months? Actually, in Google Sheets, mm is minutes, and months are mm? I’m confusing myself. Let me state clearly: In both Excel and Google Sheets, the code for month number is mm (lowercase), and the code for minute is mm only when combined with hour codes. But to avoid confusion, always use mm for month and mm for minute? No, that’s wrong. I’ll correct: In Excel, mm is month, mm is minute? Actually, Excel uses m for month and m for minute, but it depends on context. To be safe, use mm for month and mm for minute? I’ll write clearly: Use mm for month number, mmm for month abbreviation, mmmm for full month name. For minutes, use mm only when combined with hours (e.g., hh:mm). So a common mistake is using mm for month when you actually want minutes, or vice versa.
  • Using yyyy instead of yyyy for a two-digit year: yy gives a two-digit year (e.g., 25), yyyy gives a four-digit year (e.g., 2025).
  • Forgetting the day code: d gives the day number without leading zero (e.g., 5), dd gives two digits (05), ddd gives abbreviated weekday (Fri), dddd gives full weekday (Friday).
  • Putting text inside the format without quotes: In Excel, you need to enclose literal text in double quotes, e.g., dd"-"mm"-"yyyy. In Google Sheets, you can just type text directly, but it’s safer to use quotes for special characters.

Tips

  • Use ISO 8601 format (yyyy-mm-dd) for sorting dates alphabetically—it works because the year comes first.
  • Include the weekday to make schedules clearer: ddd, mmm d, yyyy shows “Fri, Mar 14, 2025â€�.
  • Use h:mm AM/PM for time if you need both date and time: mmm d, yyyy h:mm AM/PM.
  • Test with a known date like 2025-03-14 to verify your format works as expected.
  • Copy the format to other cells by using the Format Painter (Excel) or by dragging the fill handle.

Troubleshooting

  • The date displays as a number (e.g., 45000): This means the cell is formatted as a number, not a date. Re-apply the custom format, or check that the cell contains a real date value, not text.
  • The format code is rejected: Make sure you’re using the correct codes for your app. In Excel, codes must be typed exactly; in Google Sheets, you may need to use the “Custom date and timeâ€� dialog to build it visually.
  • The date appears as “######â€� (hash marks): The column is too narrow. Widen the column or change the format to a shorter version.
  • Text like “Marâ€� appears as “Marchâ€�: You used mmmm instead of mmm. Change to mmm for the abbreviated month.
  • The format works in one cell but not another: The other cell might contain text, not a date. Convert it to a date using the DATEVALUE function or re-enter it.

Frequently Asked Questions

  • Can I create a custom date format in Google Sheets on mobile? Yes, but the options are limited. Tap the cell, then tap “Formatâ€� → “Numberâ€� → “Custom date and timeâ€� and type the code.
  • How do I show the day of the week as text? Use ddd for short (Fri) or dddd for full (Friday).
  • What does mm mean in a date format? In a date-only format, mm is the month number (03 for March). If you include time, mm may be interpreted as minutes, so use mmm for month abbreviation to avoid confusion.
  • Can I use a custom format for sorting dates? Yes, but sorting works on the underlying date value, not the display. ISO format (yyyy-mm-dd) is best for text sorting.
  • How do I remove a custom format? Select the cells, go to Format Cells, and choose a standard date format (e.g., “Short Dateâ€� or “Dateâ€�).
  • Why does my format show the year as 25 instead of 2025? You used yy instead of yyyy. Change to yyyy for a four-digit year.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →