Chapter 24: Using Custom Number Formats
559
Code Comments
“text” Displays the text inside the double quotation marks.
@ Text placeholder.
[color] Displays the characters in the color specified. Can be any of the following text strings (not
case sensitive): Black, Blue, Cyan, Green, Magenta, Red, White, or Yellow.
[Color n] Displays the corresponding color in the color palette, where n is a number from 0 to 56.
[condition
value]
Set your own criterion for each section of a number format.
Table 24.4 lists the codes used to create custom formats for dates and times.
TABLE 24.4
Codes Used in Creating Custom Formats for Dates and Times
Code Comments
m Displays the month as a number without leading zeros (1–12).
mm Displays the month as a number with leading zeros (01–12).
mmm Displays the month as an abbreviation (Jan–Dec).
mmmm Displays the month as a full name (January–December).
mmmmm Displays the first letter of the month (J–D).
d Displays the day as a number without leading zeros (1–31).
dd Displays the day as a number with leading zeros (01–31).
ddd Displays the day as an abbreviation (Sun–Sat).
dddd Displays the day as a full name (Sunday–Saturday).
yy or yyyy Displays the year as a two-digit number (00–99) or as a four-digit number (1900–9999).
h or hh Displays the hour as a number without leading zeros (0–23) or as a number with leading
zeros (00–23).
m or mm Displays the minute as a number without leading zeros (0–59) or as a number with lead-
ing zeros (00–59).
s or ss Displays the second as a number without leading zeros (0–59) or as a number with lead-
ing zeros (00–59).
[ ] Displays hours greater than 24 or minutes or seconds greater than 60.
AM/PM Displays the hour using a 12-hour clock; if no AM/PM indicator is used, the hour uses a
24 hour clock.