Excel Show Numbers in Millions with Comma Guide
In this article
To show numbers in millions with a comma in Excel, you must use a Custom Number Format. Specifically, apply the format code #,##0,, "M" to your cells. This tells Excel to scale the number down by two sets of one thousand (effectively dividing by one million) while maintaining the comma as a thousands separator and adding an "M" suffix for clarity. This method changes the visual display of the data without altering the actual numerical value stored in the cell, ensuring your formulas and calculations remain accurate.
What You'll Need
- A computer with Microsoft Excel installed (works on Windows and macOS).
- A dataset containing large numbers that you wish to simplify for reporting or presentation.
- Basic familiarity with selecting cells and accessing the Format Cells menu.
Step-by-Step
- Select Your Data: Use your mouse to highlight the range of cells, the specific column, or the individual cells that contain the large numbers you want to format. To select an entire column, click the letter at the top of the column.
- Open the Format Cells Dialog: There are three ways to do this, depending on your preference. You can right-click any of the selected cells and choose Format Cells... from the context menu. Alternatively, you can use the keyboard shortcut Ctrl + 1 (Windows) or Command + 1 (macOS). You can also go to the Home tab on the ribbon, look at the Number group, and click the small arrow icon in the bottom-right corner of that group.
- Navigate to Custom Formatting: In the Format Cells window that appears, make sure you are on the Number tab. In the Category list on the left side, scroll down to the very bottom and select Custom.
- Enter the Format Code: On the right side of the window, you will see a text box labeled Type:. Delete whatever is currently in that box and carefully type the following code:
#,##0,, "M". - Understand the Code Components: To ensure you are applying this correctly, it helps to know what each part does. The
#and0are digit placeholders. The,(comma) before the zeros ensures that if the resulting number is still over a thousand, it will have a thousands separator. The two commas at the end (,,) are the "scaling" characters; each comma removes three zeros from the display. Since one million has six zeros, two commas are required. The"M"tells Excel to place the letter M after the number to indicate the unit is millions. - Apply and Confirm: Click the OK button at the bottom of the dialog box. Your numbers will now instantly transform from long strings of digits (e.g., 10,000,000) into a simplified format (e.g., 10 M).
- Optional: Adding Decimals: If your numbers are not round millions and you need to show precision (such as 10.5 M), modify the code to
#,##0.0,, "M". Adding.0or.00after the zero determines how many decimal places are visible.
Common Mistakes
One of the most frequent errors is using a single comma instead of two. A single comma at the end of a format code scales the number to thousands (K), not millions. If your 10,000,000 suddenly looks like 10,000, you likely only entered one comma.
Another common mistake is forgetting the quotation marks around the "M". In Excel custom formatting, any text you want to appear literally must be enclosed in double quotes. If you simply type #,##0,, M without quotes, Excel may return an error or fail to apply the format correctly because it interprets the M as a potential internal code.
Users also often confuse "formatting" with "calculating". Some attempt to divide their numbers by 1,000,000 using a formula (=A1/1000000). While this changes the number, it actually alters the data. If you later multiply that cell by another value, your result will be off by a factor of a million. Always prefer custom formatting for visual reports and formulas for actual data transformation.
Lastly, be careful with the placement of the comma. The comma used for the thousands separator (the one before the zero) is different from the commas used for scaling (the ones after the zero). Placing them in the wrong order will result in a format that does not display as intended.
Tips
To make your reports look professional, you can create a format that handles positive, negative, and zero values differently. Custom formats allow for up to four sections separated by semicolons: Positive; Negative; Zero; Text. For example, you could use #,##0.0,, "M";[Red](#,##0.0,, "M");0.0 "M";@. This would show positive numbers in black, negative numbers in red with a minus sign, and zeros clearly as 0.0 M.
If you find yourself using this format across multiple workbooks, consider creating a Cell Style. Select a cell with the correct million-format, go to the Home tab, click Cell Styles, and select New Cell Style. Name it "Millions Format". Now, instead of typing the code every time, you can simply apply the style from the menu.
For those working with currency, you can add a currency symbol to the start of the code. For US Dollars, use $#,##0,, "M". This keeps the currency context while maintaining the scaled-down view, which is essential for financial dashboards and executive summaries.
Troubleshooting
If the numbers do not change after you click OK, first check if the cells are formatted as Text. If a cell is explicitly set to the Text format before you enter the number, Excel treats the entry as a string of characters rather than a numeric value. Custom number formats only work on actual numbers. To fix this, change the cell format to General, click into the cell, press Enter, and then apply the custom million format again.
If you see a series of hashtags (#######) instead of your number, this usually means the column is too narrow to display the formatted result, even though the number is shorter. While "10 M" is shorter than "10,000,000", adding currency symbols or multiple decimal places can sometimes trigger this. Double-click the boundary between the column headers to auto-fit the width.
If the number looks rounded and you believe it is inaccurate, remember that formatting only changes the display. Check the Formula Bar at the top of the screen. If the Formula Bar shows the full, correct number (e.g., 10,550,000) but the cell shows "11 M", it is because your format code #,##0,, "M" does not include decimals. Change the code to #,##0.00,, "M" to see the exact precision.
In some regional versions of Excel (such as those used in parts of Europe), the comma and period are swapped. If the standard comma-based code does not work, try using a semicolon or a period depending on your system's regional settings for decimal and thousands separators.
Frequently Asked Questions
Does this change the actual value of the number?
No. Custom formatting only changes how the number is displayed on the screen and on printed pages. The underlying value remains the original large number, so all your sums, averages, and multiplications will still be calculated using the full precision.
Can I use this for billions instead of millions?
Yes. To show numbers in billions, simply add a third comma to the end of the code. Use #,##0,,, "B". Each comma effectively divides the displayed value by 1,000.
How do I remove this formatting and go back to normal?
Select the cells, go to the Home tab, and in the Number dropdown menu, select General or Number. This will remove the custom code and return the numbers to their full length.
Will this work in Google Sheets?
Yes, the logic is very similar. Go to Format > Number > Custom number format and enter the same code. Google Sheets supports the same comma-scaling syntax as Excel.
Why does my number show as 0 M when it should be 0.5 M?
This happens because the code #,##0,, "M" rounds to the nearest whole million. Because 0.5 is rounded based on the zero placeholder, it may appear as 0 or 1. To fix this, add decimal places to your code, such as #,##0.0,, "M".