To display numbers in millions in Excel without changing the actual value of the cell, use the Custom Number Format code #,##0,, "M". This method uses "comma scaling," where each comma placed after the digit placeholder divides the displayed value by 1,000. By using two commas, you effectively divide the number by 1,000,000, allowing you to present large financial or statistical data in a clean, readable format while keeping the original precise numbers for calculations.
What You'll Need
- A computer with Microsoft Excel installed (works on Windows and macOS).
- A dataset containing large numbers (e.g., 1,000,000 or higher) that you wish to simplify.
- Basic access to the Format Cells menu.
Step-by-Step
- Select your data: Use your mouse to highlight the specific cells, columns, or rows that contain the large numbers you want to format. If you want to apply this to an entire column, click the letter header at the top of the column.
- Open the Format Cells dialog: There are three ways to do this. You can right-click the selected area and choose Format Cells... from the context menu. Alternatively, you can press
Ctrl + 1(Windows) orCmd + 1(Mac) on your keyboard. You can also go to the Home tab on the ribbon, click the small arrow in the bottom-right corner of the Number group. - Navigate to Custom Formatting: In the Format Cells window, ensure you are on the Number tab. In the Category list on the left side, scroll down to the bottom and select Custom.
- Enter the formatting 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". - Adjust for decimals (Optional): If you want to show decimal places (for example, 1.2M instead of 1M), change the code to
#,##0.0,, "M"for one decimal place, or#,##0.00,, "M"for two decimal places. - Apply the changes: Click OK. Your numbers will now appear as millions, but if you click on a cell and look at the Formula Bar, you will see the original, full number is still there.
Common Mistakes
One of the most frequent errors is confusing formatting with calculation. Users often try to divide their numbers by 1,000,000 using a formula (e.g., =A1/1000000). While this changes the look of the number, it actually changes the underlying data. If you later multiply that cell by another number, your result will be off by a factor of a million. Using the Custom Format method described above ensures the data remains intact for accurate accounting and reporting.
Another common mistake is forgetting the quotation marks around the letter "M". In Excel's custom formatting language, any text you want to appear literally in the cell must be enclosed in double quotes. If you simply type #,##0,, M without quotes, Excel may return an error or fail to display the suffix correctly.
Some users also forget to include the thousands separator comma before the scaling commas. If you use 0,, "M", the number will display correctly, but you lose the comma formatting for numbers that might be in the billions (e.g., 1,200M would just look like 1200M). Using #,##0,, "M" ensures that if a number reaches 1,000 million, it is displayed as 1,000M.
Tips
Handling Billions: If your dataset includes numbers in the billions, you can create a similar format for billions by adding a third comma. The code #,##0,,, "B" will divide the displayed value by 1,000,000,000. This is incredibly useful for corporate financial statements where you may have some rows in millions and others in billions.
Conditional Formatting for Scale: If your sheet contains a mix of thousands, millions, and billions, you can use Conditional Formatting to apply different custom codes based on the value. For example, you can set a rule that says "if value is greater than 999,999, apply the #,##0,, "M" format." This prevents small numbers from being rounded down to zero or appearing as 0.0M.
Color Coding: You can add colors to your custom format to make negative numbers stand out. For example, the code [Green]#,##0,, "M";[Red]-#,##0,, "M" will make positive millions green and negative millions red. The semicolon separates the formatting for positive numbers, negative numbers, and zeros.
Using a Legend: Because you are hiding the zeros of the number, it is a professional best practice to label your column header clearly. Instead of just "Revenue," name the column "Revenue (Millions USD)". This ensures that anyone viewing the report understands the scale without having to click into the cells.
Troubleshooting
The number shows as 0: This usually happens when you use the millions format on a number that is smaller than 500,000. Because Excel rounds to the nearest whole number in the #,##0,, format, any number less than 500,000 becomes 0. To fix this, add decimal places to your code (e.g., #,##0.00,, "M"). This will allow you to see 0.25M instead of 0.
The "M" is not appearing: Check your quotation marks. Ensure you used straight quotes (") and not "curly" or "smart" quotes that sometimes occur when copying and pasting from word processors. The code must be exactly #,##0,, "M".
The number didn't change at all: Ensure the cell is actually formatted as a "Number" or "General" before applying the custom format. If the cell is formatted as "Text", Excel treats the entry as a string of characters rather than a value, and number formatting codes will have no effect. To fix this, change the cell format to General, double-click the cell to "refresh" it, and then apply the Custom format again.
Hashes (###) appear in the cell: This is not a formatting error, but a sizing issue. When you add the "M" suffix, the content of the cell becomes slightly wider. If the column is too narrow to display the result, Excel shows hashes. Simply double-click the boundary of the column header to auto-fit the width.
Frequently Asked Questions
Does this change the actual value of my data?
No. Custom formatting only changes the visual representation of the data. The actual value stored in Excel's memory remains the full number, meaning all your sums and formulas will still be 100% accurate.
Can I use this for thousands instead of millions?
Yes. To display numbers in thousands, simply use one comma instead of two. The code would be #,##0, "K".
Will this work in Google Sheets?
Yes, Google Sheets uses a very similar custom number format syntax. You can find this under Format > Number > Custom number format and enter the same code.
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 strip the custom code and show the full digits again.
Can I add a currency symbol like $ to the millions format?
Yes. Place the currency symbol at the beginning of the code. For example, $#,##0,, "M" will display the value as $1M.