Excel Number Format Formula

If you just need to excel number format formula and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: select the cells, press Ctrl+1Number ▸ Custom, and type a format code — for example 0.0,,"M" to show 12,400,000 as 12.4M.

Annotated stepsExcel
1

Select the cells, press Ctrl+1 (⌘1 on Mac) and choose the Number tab.

2

Pick the closest built-in format first — it fills the Custom box with a working code to edit.

3

Choose Custom and edit the code: 0 forces a digit, # hides an absent one, "text" adds literal characters.

4

Add a second section after a semicolon for negatives, a third for zero, a fourth for text.

5

Press Ctrl+1 ▸ Custom on another cell and paste the code, or use the Format Painter, to reuse it.

0.0,,"M"
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

A number format changes how a value is DISPLAYED and never what it is: the cell still holds 12400000, so every formula that reads it still gets 12400000. A format code has up to four sections separated by semicolons — positive;negative;zero;text — and you can supply just the first, or the first two. The building blocks are 0 (a digit, padded with zero), # (a digit, blank if absent), ? (a digit, blank but aligned), a comma as thousands separator, and quotation marks around any literal text. A comma at the END of the code divides the display by a thousand, so 0.0,, shows millions. Colours go in square brackets: [Red]. And the Accounting format is not merely currency — it aligns the currency symbol at the left edge of the cell, aligns the decimal points, and shows zero as a dash, which is what makes columns of it readable. The same idea underpins a lot of everyday Excel work, so the few minutes spent getting it right here pay back across every sheet you build afterwards. Treat it as a pattern, not a one-off, and it stops being something you look up and starts being something you reach for. For “excel number format formula”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a workspace setting that makes a big sheet comfortable to navigate useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Phone numbers stored as the digits 2125550147: Ctrl+1 ▸ Custom ▸ (000) 000-0000 displays (212) 555-0147 while the cell still contains the number, so sorting and lookups keep working. Revenue in millions: 0.0,,"M" turns 12400000 into 12.4M. Positive and negative in one code: #,##0;[Red](#,##0) shows 1,250 and (1,250) in red. Custom formats let one column serve both the reader and the formulas — a readable 12.4M on screen with the exact 12,400,000 still available to every calculation that touches it. A practical tip before you scale it up: build it once on a small block of test data, confirm the number against the tool on this page, and only then point it at your real sheet. That one habit catches almost every mistake while it is still cheap to fix, long before a wrong figure reaches a report or a colleague.

In Google Sheets

If you are in Google Sheets rather than Excel, the good news is that the formula shown here is identical and the workflow barely changes — menus sit across the top instead of in a ribbon, and a few function names differ slightly, but anything you build here moves across with little or no rework. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top, the tool proves it, and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. The short version of “excel number format formula”: the answer is at the top of this page, the tool proves it on your own numbers, and the sections above explain why it holds so the next variation does not stump you. Excel rewards people who reference cells instead of typing values and who keep inputs separate from formulas, because that is what makes a result you can audit months later. Build it once, deliberately, with the live tool as a check, and you convert a one-off lookup into a reusable skill — which is the whole point of learning the why and not just the what.

Common mistakes

  • Expecting a format to change the value — the cell still holds the full number, which is why a "rounded" column can still fail to add up on screen.
  • Formatting phone numbers that were entered as TEXT: a number format has no effect on text, and leading zeros mean they probably are text.
  • Using a custom format to hide decimals and then quoting the displayed figure as if it were exact.
  • Reaching for the currency format when the column needs Accounting, which is what aligns the symbols and decimal points.
  • Building a format with three commas expecting billions and getting a blank-looking cell, because each trailing comma divides by another thousand.

Frequently asked questions

How do I create a custom number format in Excel?

Select the cells, press Ctrl+1, choose Number ▸ Custom and type a format code such as #,##0.00 or 0.0,,"M".

How do I format phone numbers in Excel?

Ctrl+1 ▸ Custom ▸ (000) 000-0000 for US numbers. If the cells contain text rather than digits, convert them to numbers first or the format will do nothing.

What is the accounting number format?

A currency format that left-aligns the currency symbol at the cell edge, lines up the decimal points, and shows zero as a dash. Home ▸ Number ▸ Accounting, or Ctrl+Shift+$ for plain currency.

How do I show numbers in millions?

Use the custom code 0.0,,"M" — two trailing commas divide the display by a million, and the underlying value is unchanged.

What do the semicolons in a format code mean?

They separate up to four sections: positive;negative;zero;text. Supplying fewer sections is fine, and an empty section hides that case entirely.

Other ways people ask this

On the way here you may have searched this as “excel number format”, “format a number in excel”, “excel format number” and “format number excel formula” — it is all the same task, and this page is the single, complete answer to it.

Why do people search for this in so many different ways?

Because the same task has many names. “excel number format”, “format a number in excel”, “excel format number” all point at the one operation explained on this page, which is why they all lead here.