Custom Number Format Excel: Step-by-Step Guide
What You'll Be Able to Build, and What to Open Before You Create a Custom Number Format in Excel
Roughly 90% of Excel users have never opened the Custom category in the Format Cells dialog. [VERIFY: 90% statistic — source needed or soften to "most"] They use the preset buttons (currency, percentage, comma) and accept whatever Excel decides to display. That works until it doesn't: a report goes out showing 1500000 instead of $1.5M, or a percentage cell reads 1.5 when it means 150%. I've seen a single formatting assumption like that quietly distort a financial review. A custom number format in Excel lets you control exactly what a number looks like, without touching the underlying value.
This guide gives you copy-paste-ready format codes and the structure to build your own. Before you type a single code, you need one thing open.
|
| The Custom category inside Format Cells is where every format code in this guide lives. |
Open the Format Cells Dialog Before You Type a Single Code
Select any cell in Microsoft Excel or Microsoft 365, then press Ctrl+1. That opens the Format Cells dialog directly. Click the Number tab if it's not already showing, scroll to the bottom of the Category list, and select Custom. The Type field at the top is where your format code goes. The preview updates live as you type, so use it.
A custom number format changes what a number displays, not what it is. A cell formatted to show $1.5M still holds the value 1500000. Every formula that references it uses 1500000. The format is a lens, not a transformation. Keep that separation in your head for everything that follows.
If you're new to working with Excel's core interface and cell structure, it's worth getting that foundation in place before customizing number display.
Step 1: Read the Custom Format Code Structure So You Know What You're Actually Typing
Now that the dialog is open, resist the urge to start copying codes before understanding what they're made of. The number format syntax follows a four-section structure separated by semicolons: positive; negative; zero; text. You don't have to fill all four. A single section applies to every number. Two sections split positive/negative from zero and text. But knowing all four exist saves a lot of confusion.
The Four Sections: Positive, Negative, Zero, Text
A format string like #,##0.00;(#,##0.00);"-";@ handles all four conditions in one code. Positive numbers get comma formatting with two decimals. Negative numbers appear in parentheses, the standard accounting style. Zero displays as a dash. Text passes through unchanged via the @ placeholder. It looks like someone sat on a keyboard, but one section at a time, it's actually readable. The conditional format sections give you surgical control over each number state.
Digit Placeholders #, 0, and ?, and When Each One Matters
Three characters do most of the heavy lifting in any custom format string:
- #: shows a digit if one exists, suppresses it if not.
#.##turns 1.50 into 1.5. - 0: forces a digit, padding with zero if the position is empty.
000turns 7 into 007. This is how you format numbers with leading zeros in Excel. - ?: like
#, but adds a space instead of suppressing, which aligns decimal points in a column without padding with zeros.
I used to mix up # and 0 constantly early in my career. The rule that finally stuck: use 0 wherever a missing digit would create ambiguity, and # everywhere else.
Step 2: Build and Apply Your First Custom Number Format in Excel
With the structure clear, you're ready to actually build something. Open Format Cells with Ctrl+1, go to Custom, and type your code in the Type field. Hit OK. That's the whole mechanical process. The skill is in choosing the right code.
Thousands, Millions, and the Scaling Trick Most Guides Skip
Here's a cheat sheet of format codes I use in active FP&A models. These cover the cases that come up in real financial work, not academic exercises.
| Goal | Format Code | Input → Display |
|---|---|---|
| Thousands separator | #,##0 |
1500000 → 1,500,000 |
| Thousands (scale to K) | #,##0.0, |
1500000 → 1,500.0 |
| Millions (scale to M) | $#,##0.0,, |
1500000 → $1.5 |
| Millions labeled | "$"#,##0.0,,"M" |
1500000 → $1.5M |
| Percentage (clean) | 0.0% |
0.153 → 15.3% |
| Accounting (parentheses) | #,##0.00_);(#,##0.00) |
-500 → (500.00) |
| Hide zero values | #,##0;-#,##0;"" |
0 → (blank) |
| Leading zeros (ID codes) | 00000 |
42 → 00042 |
The scaling trick: each trailing comma after the format code divides the displayed value by 1,000. Two commas means divide by 1,000,000. The underlying cell value stays untouched. This is part of the broader data entry and formatting system in Excel, where formatting and values are always separate layers.
To apply a custom format to an entire column, click the column header to select it, then Ctrl+1 and apply your code. Every cell in that column, including ones you add later, will inherit the format. In practice, I apply column-level formats before entering data in any model I'm building from scratch.
The standard number formatting options in Excel cover most everyday cases. Custom codes are for the gaps those presets can't fill.
The same format code syntax works inside the TEXT function. =TEXT(A1,"$#,##0.0,,""M""") outputs a formatted string directly in a formula result. Useful for dashboard labels, concatenated report lines, or any situation where you need the display and the formula output to be the same thing.
Common Mistakes That Break Your Custom Number Format in Excel, and How to Fix Them
Three failure points account for almost every "why isn't this working" question I've seen in Excel forums.
The Format Applies but Nothing Changes
This usually means the cell contains a text-stored number. Excel sees it as text, not a value, so number formatting has nothing to act on. Look for a small green triangle in the cell's corner. Click the warning icon and choose Convert to Number. Then reapply your format code.
The Code Behaves Differently on Someone Else's Machine
Locale matters. Decimal separators, currency symbols, and date delimiters in format codes follow the system's regional settings. A code built in a US locale may render incorrectly for a colleague using a European locale. If you're distributing a file internationally, test it. This surfaces more often now that cross-border collaboration is the default for most teams.
Confusing Custom Formatting with Conditional Formatting
They sound similar but work completely differently, and the performance difference is real. Conditional formatting re-evaluates on every calculation cycle and can noticeably slow a large workbook. A custom number format evaluates once at display time. If you only need to change how a number looks (not apply fills, borders, or icons based on value), a custom format is always faster. Save conditional formatting for when you actually need the cell's visual properties to respond to logic.
Google Sheets compatibility: Most basic format codes (#,##0, 0.0%, date patterns) work identically in Google Sheets. The scaling commas trick (#,##0,,) and some advanced conditional format sections may not. Google's Sheets number format documentation lists what's supported if you need to verify before sharing a file cross-platform.
For anything more advanced, like applying formats programmatically across a large file or building dynamic format strings, Excel's VBA NumberFormat property uses the same custom format string syntax you've already learned here.
Frequently Asked Questions
How do I create a custom number format in Excel?
Select your cell, press Ctrl+1 to open the Format Cells dialog, click the Number tab, and choose Custom from the category list. Type your format code in the Type field and click OK. The preview updates in real time as you type, so you can check the output before confirming.
Why is my custom number format not working in Excel?
The most common cause is text-stored numbers. If Excel treats a cell as text, number formats won't apply. Check for a green triangle in the cell corner and use the Convert to Number option. Locale mismatches can also cause codes to render incorrectly on machines with different regional settings.
How do I format numbers in thousands or millions in Excel?
Add a trailing comma to your format code to scale by thousands. One comma (#,##0,) divides the display by 1,000; two commas (#,##0,,) divide by 1,000,000. The underlying cell value is unchanged, only the display scales. Add a label like "M" or "K" in quotes at the end to make the unit explicit.
Can I use Excel custom number formats in Google Sheets?
Most standard codes (thousands separators, percentage formats, basic date patterns) transfer cleanly. Advanced syntax like the thousands-scaling comma trick or multi-section conditional formats may not behave identically. Always test in Sheets before distributing a file that relies on specific custom formatting.
Join the conversation