Excel Module 2 - Number Formatting Codes
Excel Module 2 - Number Formatting Codes
Number Code
General
Text Code
_
$ - + / ( ) : space
\character
"text"
"text"
Date Code
d
dd
ddd
dddd
mm
mmm
mmmm
mmmmm
yy
yyyy
Time Code
h
hh
mm
ss
[h]
[mm]
[ss]
AM/PM am/pm
Color Code
[Black]
[Red]
[Green]
[White]
[Blue]
[Magenta]
[Cyan]
[Yelllow]
[Color n]
CUSTOM NUMBER FORMAT CODES
Description
General number format
Digit placeholder. Whether or not the digit is relevant to the value, it will be shown
Display the number into percentage format. Numbers are multipled by 100 and added % sign at start
Description
Space character modifier. A character to display an empty space equal in size to the specified character
To display the characters in the number. To display any character, enclose the character in quotation marks or precede it with
backslash
Text placeholder
Insert multiple characters around the number with number format codes
Insert multiple characters around the number with number format codes
Display a repeating digit that fills the empty space or column width before actual number in a cell
Description
Day as number without leading zeros (1 - 31)
Description
Hours as a number without leading zeros (0 - 23)
Description
Note that, [Color n] 'n' is a value between 1 and 56 and refers to the nth color in the color plate
S
Sample Format Code Sample Sample Output
General 9879.2 9879.2
# 9879.2 9879
dd 1-Aug-23 01
m 1-Aug-23 8
mm 1-Aug-23 08
yy 1-Aug-23 23
hh 10:08 PM 22
Format Output
mdyy 8124
dd-mmm-yyyy 01-Aug-2024
mmm dd, yy Aug 01, 24
dddd, dd mmm, yyyy Thursday, 01 Aug, 2024
mmmm mm-dd-yyyy August 08-01-2024
Examples:
To display Time in different Time Formats
Format Output
hmmss 131228
hh:mm:ss 13:12:28
hh:mm "hours" 13:12 hours
hh "hours &" mm "minutes" 13 hours 12 minutes, and 28 seconds
hh:mm AM/PM 01:12 PM