Custom number formats in Excel: currency text, codes, colors and hiding
Excel custom format codes: add “UZS”, keep 00125 codes, [Red] colors, hide values with ;;;, dddd weekdays and [h]:mm — with examples and traps.
When the built-in formats aren’t enough, you write a Custom format. It is a short code that tells Excel how to display a number: for example, #,##0" UZS" shows 1500000 as “1,500,000 UZS”.
The key point: the cell still holds a number. SUM, sorting and charts work as usual. If you typed “1,500,000 UZS” by hand, you would get text that can’t be calculated. A custom format gives you both: a clean look and full calculations.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | Code | Price | Change | |
| 2 | Rice | 00125 | 18 000 UZS | ▲ 12.0% | |
| 3 | Oil | 00342 | 32 000 UZS | ▼ 4.5% | |
| 4 | Sugar | 01207 | 14 500 UZS | ▲ 3.0% | |
| 5 | Flour | 00088 | 9 000 UZS | 0.0% | |
| 6 |
Creating a custom format
1
Select the cells (for example, prices in C2:C5) and press Ctrl + 1.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Code | Price | |
| 2 | Rice | 125 | 180001 | |
| 3 | Oil | 342 | 32000 | |
| 4 | Sugar | 1207 | 14500 | |
| 5 | Flour | 88 | 9000 | |
| 6 |
2
In Format Cells, open the Number tab and choose Custom at the bottom of the list. The Type box and a list of ready-made codes appear on the right.
3
Type the code into the Type box: #,##0" UZS". The Sample box above shows the result immediately, so you can fix mistakes on the spot.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Code | Price | |
| 2 | Rice | 125 | 18000 | |
| 3 | Oil | 342 | 32000 | |
| 4 | Sugar | 1207 | 14500 | |
| 5 | Flour | 88 | 9000 | |
| 6 |
4
Click OK. Look at the formula bar: C2 still holds 18000 — only the display changed. Give the Code column the 00000 format the same way.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Product | Code | Price | |
| 2 | Rice | 125 | 18 000 UZS | |
| 3 | Oil | 342 | 32 000 UZS | |
| 4 | Sugar | 1207 | 14 500 UZS | |
| 5 | Flour | 88 | 9 000 UZS | |
| 6 |
The “alphabet” of format codes
The codes below are for English regional settings (dot for decimals, comma for thousands):
0— required digit: if the number is shorter, a 0 is shown in its place. With00000, 125 → 00125.#— optional digit: shows no extra zeros.- Comma (
#,##0) — thousands separator; dot (0.00) — decimal part. "text"— text in quotes is shown as is:" UZS"," kg".%— multiplies by 100 and adds %.@— placeholder for text:"ID-"@→ ID-Aziz.[Red],[Blue],[Green]— color; numbered colors like[Color10]exist too.- Dates:
dd— day,ddd/dddd— weekday (short/full),mm/mmmm— month number/name,yyyy— year.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Value | Format code | Displays as | |
| 2 | 1500000 | #,##0" UZS" | 1,500,000 UZS | |
| 3 | 125 | 00000 | 00125 | |
| 4 | 901234567 | "+998 "00" "000-00-00 | +998 90 123-45-67 | |
| 5 | 45658 | dddd | Wednesday | |
| 6 | 45658 | mmmm yyyy | January 2025 | |
| 7 | -350000 | #,##0;[Red]-#,##0 | -350,000 | |
| 8 | 0 | #,##0;-#,##0;"—" | — | |
| 9 |
Four sections: positive; negative; zero; text
A code can have up to 4 sections separated by semicolons: positive;negative;zero;text.
#,##0;[Red]-#,##0— negative numbers in red.#,##0;(#,##0);"—"— negatives in parentheses, a dash instead of zero (like in financial statements).;;;— every section empty: nothing is visible in the cell, but the value is still there and formulas use it.
Note: in the second section you add the minus sign yourself. With #,##0;#,##0, −350,000 is displayed as 350,000.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Employee | Salary | Total | |
| 2 | Aziz | 52000001 | 16 100 000 | |
| 3 | Dilnoza | 6100000 | ||
| 4 | Javohir | 4800000 | ||
| 5 |
Pro level: hours, thousands, conditions
- Time over 24 hours. When you add up working hours,
hh:mmshows 28 hours as 04:00 — it drops whole days. The right code is[h]:mm. The square brackets mean “hours without rolling over into days”. - In thousands and millions. A thousands separator at the end of the code divides the number by 1000:
#,##0," K"→ 2,400,000 = “2,400 K”. Two separators divide by a million:0.0,," mln"→ “2.4 mln”. - Conditions. You can put up to 2 conditions in square brackets:
[>=90]"Excellent";[>=70]"Good";"Pass"— the score stays a number but is displayed as a word. - Neat arrows.
[Color10]"▲ "0.0%;[Red]"▼ "0.0%;0.0%— growth in dark green, decline in red.[Green]is a harsh bright green;[Color10]is much easier to read.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Day | Hours worked | ||
| 2 | Monday | 09:00 | ||
| 3 | Tuesday | 10:00 | ||
| 4 | Wednesday | 09:00 | ||
| 5 | Total — hh:mm | 04:001 | ||
| 6 | Total — [h]:mm | 28:002 | ||
| 7 |
Has ExcelLab been useful?
Support the project and help us release new lessons and exercises.