Excel - Custom Date Format
Excel - Custom Date Format
com
Ablebits.com /
Blog /
Excel /
Date /
Search
Mar
11
The first part of our tutorial focuses of formatting dates in Excel and explains how to set the default date and time
formats, how to change date format in Excel, how to create custom date formatting, and convert your dates to
another locale.
Along with numbers, dates and times are the most common data types people use in Excel. However, they may be
quite confusing to work with, firstly, because the same date can be displayed in Excel in a variety of ways, and
secondly, because Excel always internally stores dates in the same format regardless of how you have formatted a
date in a given cell.
Knowing the Excel date formats a little in depth can help you save a ton of your time. And this is exactly the aim of
our comprehensive tutorial to working with dates in Excel. In the first part, we will be focusing on the following
features:
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
Excel stores dates as sequential numbers and it is only a cell's formatting that causes a number to be displayed as
a date, time, or date and time.
Dates in Excel
All dates are stored as integers representing the number of days since January 1, 1900, which is stored as number
1, to December 31, 9999 stored as 2958465.
In this system:
2 is 2-Jan-1900
3 is 3-Jan-1900
Time in Excel
Times are stored in Excel as decimals, between .0 and .99999, that represent a proportion of the day where .0 is
00:00:00 and .99999 is 23:59:59.
For example:
0.25 is 06:00 AM
0.5 is 12:00 PM
0.541655093 is 12:59:59 PM
For example:
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
If you want to know what serial number represents a certain date or time displayed in a cell, you can do this in two
ways.
If you just want to know the serial number behind the date, without actually converting date to number, write down
the number you see under Sample and click Cancel to close the window. If you want to replace the date with the
number in a cell, click OK.
Use the Format Cells dialog to get the number behind a given date in Excel.
Use the TIMEVALUE() function to get the decimal number representing the time, for example =TIMEVALUE("6:30
AM").
To know both, date and time, concatenate these two functions in the following way:
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
Note. Since Excel's serial numbers begins on January 1, 1900 and negative numbers aren't recognized, dates
prior to the year 1900 are not supported in Excel.
If you enter such a date in a sheet, say 12/31/1899, it will be a text value rather than a date, meaning that you
cannot perform usual date arithmetic on early dates. To make sure, you can type the formula
=DATEVALUE("12/31/1899") in some cell, and you will get an anticipated result - the #VALUE! error.
If you are dealing with date and time values and you'd like to convert time to decimal number, please check out
the formulas described in this tutorial: How to convert time to decimal number in Excel.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
The default date and time formats in the Format Cell box change as soon as you change the date and time settings
in Control Panel, which leads us right to the next section.
On the Formats tab, choose the region under Format, and then set the date and time formatting by clicking on an
arrow next to the format you want to change and selecting the desired one from the drop-down list:
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
Tip. If you are not sure what different codes (such as mmm, ddd, yyy) mean, click the "What does the notation
mean" link under the Date and time formats section, or check the Custom Excel date formats in this tutorial.
If you are not happy with any time and date format available on the Formats tab, click the Additional settings
button in the lower right-hand side of the Region and Language dialog window. This will open the Customize dialog,
where you switch to the Date tab and enter a custom short or/and long date format in the corresponding box.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
To quickly change date format in Excel to the default formatting, do the following:
On the Home tab, in the Number group, click the little arrow next to the Number Format box, and select the
desired format - short date, long date or time.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
If you want more date formatting options, either select More Number Formats from the drop-down list or click the
Dialog Box Launcher next to Number. This will open a familiar Format Cells dialog and you can change date format
there.
Tip. If you want to quickly set date format in Excel to dd-mmm-yy, press Ctrl+Shift+# . Just keep in mind that
this shortcut always applies the dd-mmm-yy format, like 01-Jan-15, regardless of your Windows Region
settings.
1. Select the dates whose format your want to change, or empty cells where you want to insert dates.
2. Press Ctrl+1 to open the Format Cells dialog. Alternatively, you can right click the selected cells and choose
Format Cells… from the context menu.
3. In the Format Cells window, switch to the Number tab, and select Date in the Category list.
4. Under Type, pick a desired date format. Once you do this, the Sample box will display the format preview with
the first date in your selected data.
5. If you are happy for the preview, click the OK button to save the format change and close the window.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
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.
The easiest way to change date format in Excel based on how another language displays dates is as follows:
Select the language you want under Locale (location) and click OK to save the change.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
If you want the dates to be displayed in another language, then you will have to create a custom date format with a
locale code.
3. On the Number tab, select Custom from the Category list and type the date format you want in the Type box.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
Tip. The easiest way to set a custom date format in Excel is to start from an existing format close to what you
want. To do this, click Date in the Category list first, and select one of existing formats under Type. After that
click Custom and make changes to the format displayed in the Type box.
When setting up a custom date format in Excel, you can use the following codes.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
When setting up a custom time format in Excel, you can use the following codes.
To set up date and time format, include both date and time units in your format code, e.g. m/d/yyyy h:mm AM/PM.
When you use "m" immediately after "hh" or "h" or immediately before "ss" or "s", Excel will display minutes, not a
month.
When creating a custom date format in Excel, you can use a comma (,) dash (-), slash (/), colon (:) and other
characters.
For example, the same date and time, say January 13, 2015 13:03, can be displayed in a various ways:
Format Displays as
dd-mmm-yy 13-Jan-15
mm/dd/yyyy 01/13/2015
m/dd/yy 1/13/15
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
If you want to display dates in another language, you have to create a custom format and prefix a date with a
corresponding locale code. The locale code should be enclosed in [square brackets] and preceded with the dollar
sign ($) and a dash (-). Here are a few examples:
You can find the full list of locale codes on this blog.
For example, this is how you set up a custom Excel date format for the Chinese locale in the year-month-day (day
of the week) time format:
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
The following image shows a few examples of the same date formatted with different locale codes in the way
traditional for the corresponding languages:
Solution. Double-click the right border of the column to resize it to auto fit the dates. Alternatively, you can drag the
right border to set the column width you want.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
If you want to display negative numbers as negative dates, two options are available to you:
Go to File > Options > Advanced, scroll down to the When calculating this workbook section, select the Use 1904
date system check box, and click OK.
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]
How to change Excel date format and create custom formatting - Ablebits.com
Of course, such representation is very unusual and takes time to get used to, but this is the right way to go if you
want to perform calculations with early dates.
Another possible way to display negative numbers as negative dates in Excel is using the TEXT function. For
example, if you are subtracting C1 from B1 and a value in C1 is greater than in B1, you can use the following
formula to output the result in the date format:
=TEXT(ABS(B1-C1),"-d-mmm-yyyy")
You may want to change the cell alignment to right justified, and naturally, you can use any other custom date
formats in the TEXT formula.
Note. Unlike the previous solution, the TEXT function returns a text value, that is why you won't be able to use
the result in other calculations.
Solution. You can convert "text dates" to the date format using Excel's DATEVALUE function or Text to Columns
feature. Please see the following article for full details: How to convert text to date in Excel.
This is how you format dates in Excel. In the next part of our guide, we will discuss various ways of how you can
insert dates and times in your Excel worksheets. Thank you for reading and see you next week!
https://www.ablebits.com/...hange-date-format-excel/#:~:text=Select%20the%20column%20of%20dates,OK%20to%20save%20the%20change.[08.03.2022 10:12:32]