Format numbers as dates or times (2024)

Excel

Enter and format data

Format data

Format data

Format numbers as dates or times

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 More...Less

When you type a date or time in a cell, it appears in a default date and time format. This default format is based on the regional date and time settings that are specified in Control Panel, and changes when you adjust those settings in Control Panel. You can display numbers in several other date and time formats, most of which are not affected by Control Panel settings.

In this article

  • Display numbers as dates or times

  • Create a custom date or time format

  • Tips for displaying dates or times

Display numbers as dates or times

You can format dates and times as you type. For example, if you type 2/2 in a cell, Excel automatically interprets this as a date and displays 2-Feb in the cell. If this isn't what you want—for example, if you would rather show February 2, 2009 or 2/2/09 in the cell—you can choose a different date format in the Format Cells dialog box, as explained in the following procedure. Similarly, if you type 9:30 a or 9:30 p in a cell, Excel will interpret this as a time and display 9:30 AM or 9:30 PM. Again, you can customize the way the time appears in the Format Cells dialog box.

  1. On the Home tab, in the Number group, click the Dialog Box Launcher next to Number.

    Format numbers as dates or times (1)

    You can also press CTRL+1 to open the Format Cells dialog box.

  2. In the Category list, click Date or Time.

    Format numbers as dates or times (2)

  3. In the Type list, click the date or time format that you want to use.

    Note:Date and time formats that begin with an asterisk (*) respond to changes in regional date and time settings that are specified in Control Panel. Formats without an asterisk are not affected by Control Panel settings.

  4. To display dates and times in the format of other languages, click the language setting that you want in the Locale (location) box.

    Format numbers as dates or times (3)

    The number in the active cell of the selection on the worksheet appears in the Sample box so that you can preview the number formatting options that you selected.

    Format numbers as dates or times (4)

Top of Page

Create a custom date or time format

  1. On the Home tab, click the Dialog Box Launcher next to Number.

    Format numbers as dates or times (5)

    You can also press CTRL+1 to open the Format Cells dialog box.

  2. In the Category box, click Date or Time, and then choose the number format that is closest in style to the one you want to create. (When creating custom number formats, it's easier to start from an existing format than it is to start from scratch.)

  3. In the Category box, click Custom. In the Type box, you should see the format code matching the date or time format you selected in the step 3. The built-in date or time format can't be changed or deleted, so don't worry about overwriting it.

  4. In the Type box, make the necessary changes to the format. You can use any of the codes in the following tables:

    Days, months, and years

To display

Use this code

Months as 1–12

m

Months as 01–12

mm

Months as Jan–Dec

mmm

Months as January–December

mmmm

Months as the first letter of the month

mmmmm

Days as 1–31

d

Days as 01–31

dd

Days as Sun–Sat

ddd

Days as Sunday–Saturday

dddd

Years as 00–99

yy

Years as 1900–9999

yyyy

If you use "m" immediately after the "h" or "hh" code or immediately before the "ss" code, Excel displays minutes instead of the month.

Hours, minutes, and seconds

To display

Use this code

Hours as 0–23

h

Hours as 00–23

hh

Minutes as 0–59

m

Minutes as 00–59

mm

Seconds as 0–59

s

Seconds as 00–59

ss

Hours as 4 AM

h AM/PM

Time as 4:36 PM

h:mm AM/PM

Time as 4:36:03 P

h:mm:ss A/P

Elapsed time in hours; for example, 25.02

[h]:mm

Elapsed time in minutes; for example, 63:46

[mm]:ss

Elapsed time in seconds

[ss]

Fractions of a second

h:mm:ss.00

AM and PM If the format contains an AM or PM, the hour is based on the 12-hour clock, where "AM" or "A" indicates times from midnight until noon and "PM" or "P" indicates times from noon until midnight. Otherwise, the hour is based on the 24-hour clock. The "m" or "mm" code must appear immediately after the "h" or "hh" code or immediately before the "ss" code; otherwise, Excel displays the month instead of minutes.

Creating custom number formats can be tricky if you haven't done it before. For more information about how to create custom number formats, see Create or delete a custom number format.

Top of Page

Tips for displaying dates or times

  • To quickly use the default date or time format, click the cell that contains the date or time, and then press CTRL+SHIFT+# or CTRL+SHIFT+@.

  • If a cell displays ##### after you apply date or time formatting to it, the cell probably isn't wide enough to display the data. To expand the column width, double-click the right boundary of the column containing the cells. This automatically resizes the column to fit the number. You can also drag the right boundary until the columns are the size you want.

  • When you try to undo a date or time format by selecting General in the Category list, Excel displays a number code. When you enter a date or time again, Excel displays the default date or time format. To enter a specific date or time format, such as January 2010, you can format it as text by selecting Text in the Category list.

  • To quickly enter the current date in your worksheet, select any empty cell, and then press CTRL+; (semicolon), and then press ENTER, if necessary. To insert a date that will update to the current date each time you reopen a worksheet or recalculate a formula, type =TODAY() in an empty cell, and then press ENTER.

Need more help?

You can always ask an expert in the Excel Tech Communityor get support inCommunities.

Need more help?

Want more options?

Discover Community

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Format numbers as dates or times (6)

Microsoft 365 subscription benefits

Format numbers as dates or times (7)

Microsoft 365 training

Format numbers as dates or times (8)

Microsoft security

Format numbers as dates or times (9)

Accessibility center

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Format numbers as dates or times (10)

Ask the Microsoft Community

Format numbers as dates or times (11)

Microsoft Tech Community

Format numbers as dates or times (2024)

FAQs

Why is Excel formatting my numbers as dates? ›

Microsoft Excel is preprogrammed to make it easier to enter dates. For example, 12/2 changes to 2-Dec. This is very frustrating when you enter something that you don't want changed to a date. Unfortunately there is no way to turn this off.

How to format as date in numbers? ›

Numbers automatically interprets text strings that you type in a recognized date format as dates (for example, 6/10/17).
  1. Select the cells or table you want to format.
  2. In the Format sidebar, click the Cell tab, then click the Data Format pop-up menu and choose Date & Time.

How do you convert number format to date format? ›

On the Home tab, in the Number group, click the Dialog Box Launcher next to Number. You can also press CTRL+1 to open the Format Cells dialog box. In the Category list, click Date or Time. In the Type list, click the date or time format that you want to use.

How do you format dates and times? ›

In traditional American usage, dates are written in the month–day–year order (e.g. September 16, 2024) with a comma before and after the year if it is not at the end of a sentence and time in 12-hour notation (10:59 pm).

How to stop Excel converting numbers to dates? ›

Special formatting tricks to avoid having Excel change numbers into dates
  1. Add a space before the number. ...
  2. Or, add an apostrophe (') BEFORE you enter the number, e.g. '1/2. ...
  3. Or, add a zero and space before number formats such as 1/2 to avoid the change to date format.
Sep 4, 2023

How do I fix number formatting in Excel? ›

How? Select the cells that you want to format. On the Home tab, in the Number group, click the dialog box launcher next to Number (or just press CTRL+1). In the Category list, click the format that you want to use, and then adjust settings, if necessary.

How do I put numbers in date format in Excel? ›

Follow these steps:
  1. Select the cells you want to format.
  2. Press Control+1 or Command+1.
  3. In the Format Cells box, click the Number tab.
  4. In the Category list, click Date.
  5. Under Type, pick a date format.

How do you write numbers in dates? ›

The international standard recommends writing the date as year, then month, then the day: YYYY-MM-DD. So if both Australians and Americans used this, they would both write the date as 2019-02-03. Writing the date this way avoids confusion by placing the year first.

How do I convert a Number to a date on a spreadsheet? ›

For this, simply pick Date in the Number Format box on the Home tab. To apply a format other than default, then select the cells with serial numbers and press Ctrl+1 to open the Format Cells dialog. On the Number tab, choose Date, select the desired date format under Type and click OK. Yep, it's that easy!

What is the formula for number to date in Excel? ›

You will need to change the number format (Format Cells) in order to display a proper date. For example: =DATE(C2,A2,B2) combines the year from cell C2, the month from cell A2, and the day from cell B2 and puts them into one cell as a date. The example below shows the final result in cell D2.

Why can't I change the date format in Excel? ›

If the date format is not changing in your Excel sheet, most likely your dates are formatted as text and you have to convert them to the date format first.

How do you convert a date to a number format? ›

Convert Text Date into a Number
  1. Enter the “=DATEVALUE” in a cell.
  2. Then enter starting parentheses.
  3. Refer to the cell where you have the date.
  4. Now, enter closing parentheses and hit enter.

How do I format a date in numbers? ›

Click the Cell tab at the top of the sidebar. In the Data Format section, use the drop-down boxes to change the Date or Time format.

What is the correct date format? ›

The standard format for writing dates in the United States is Month-Day-Year. For example, “August 30, 2023.” You may also see the month abbreviated to three letters, such as “Aug 30, 2023.”

What is the best format for date and time? ›

The ISO 8601 date format is considered the best because it eliminates ambiguity and confusion. It is an international standard that follows the format “YYYY-MM-DD”. This format is universally understood and is not subject to regional variations.

How do I change the date format to normal numbers in Excel? ›

Select the cell(s) that contain values you want to format. Click the Number Format list arrow from the Home tab. Select the number or date format you want to apply.

How do I stop Excel from changing number format? ›

You can prevent this automatic number formatting by applying the Text format to the cells. It's easy to do: Select the cells that contain numbers you don't want Excel to automatically format. Select CTRL+1.

How do I fix the date format in an Excel cell? ›

Follow these steps:
  1. Select the cells you want to format.
  2. Press CTRL+1.
  3. In the Format Cells box, click the Number tab.
  4. In the Category list, click Date.
  5. Under Type, pick a date format. ...
  6. If you want to use a date format according to how another language displays dates, choose the language in Locale (location).

How to get rid of date format in Excel? ›

Remove formatting from a date, time, or number
  1. Double-click the date picker, text box, or expression box whose formatting you want to remove.
  2. In the Control Properties dialog box, do one of the following: ...
  3. Click Format.
  4. In the Format dialog box, click None (display XML value).

Top Articles
VM Performance Dashboard
Real Estate Risk Management: How to Avoid Common Threats | Insureon
Evansville Craigslist Com
417-990-0201
Paradisehilltv
Leora From Real Life Cam
How to Use Craigslist (with Pictures) - wikiHow
15 Universal Studios Hollywood Tips You NEED To Read (2023)
One Barred From Bars Daily Themed Crossword
Fantasy Football Week 3: 5 players who could make or break your lineups
Pubblicare Annunci Gratuiti - comprare e vendere usato in Italia | CLASF
Revit Forums
Margaret Whitton Feet
2065660072
Craigslist Pet Phoenix
XFN: Introduction and Examples
Las Vegas Noaa
Take Me To The Closest Ups
Cómo lograr un color borgoña en el cabello negro
No Hard Feelings Showtimes Near Reading Cinemas Town Square
Black Tumblr Wallpaper
Regal Movie Listings
Magicseaweed Jacksonville Fl
Aa116340-4010
24 Hour Drive Thru Car Wash Near Me
Nrsv Oremus Bible Browser
Laughing Out Loud: 57+ Ligma Jokes That Will Crack You Up!
Citibank Branch Locations In Orlando Florida
O'reilly's Madras Oregon
Thankathon
Nbstsa Verification
Product Support Centre & Downloads | Kyocera Document Solutions
Vocabulary Workshop Level C Final Mastery Test Answers
Care First Arizona
Tmobile Ipad 10Th Gen
David Baker, biochemist: ‘Now we can build completely new proteins to do exactly what we want’
Horry County Mugshots September 18th, 2024 - WFXB
Series of scorching days: Last week the hottest worldwide on record: UN
Different Types of Conditional Sentences in English: Definition and Examples | Proofreading
I Just Can't Wait to Be King
Selling Sunset's Emma Hernan Reveals Truth Behind 'Affair With Married Man' Rumour
Mlm Urban Meaning
Learn4Good Job Posting
Comment résoudre l'erreur « Could not resolve hostname: nodename nor servname provided, or not known » ?
Little Caesars Saul Kleinfeld
Saint Frances Cabrini West Bend Wi
Wvtm 13 Schedule
St Edwards Bloomington Mn
Nearest Five Below To My Location
20Xx Training Pack
Mangakakalot Read Online
Fcs East Rhinos
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 6366

Rating: 4.3 / 5 (54 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.