To show Excel chart values in millions, apply the custom number format #,##0,,"M"; for one decimal place, use 0.0,,"M". In a chart, select the value axis, open Format Axis, then enter the code under Number > Format Code and choose Add. The format changes how values appear, not the underlying data.
What the millions format code means
Excel custom number formats use commas in two different ways. A comma between digit placeholders can mark thousands for grouping, as in #,##0. A comma at the end of a number format scales the displayed value down by 1,000. Each additional trailing comma divides the display by another 1,000, so two commas divide by 1,000,000.
That is why #,##0,,"M" can turn an underlying value of 1,234,567 into a chart label of 1M. The format rounds to a whole displayed million. The value remains 1,234,567 in the worksheet and in chart calculations; only its presentation changes. The quoted M is literal text appended to the formatted number.
Use these common variations according to the detail your chart needs:
#,##0,,"M"displays whole millions, such as 2M.0.0,,"M"displays one decimal place, such as 2.4M.0.00,,"M"displays two decimal places, such as 2.42M.$#,##0,,"M"displays a dollar sign with whole millions, such as $2M.
Apply the code to a chart axis in Excel
These steps are for Excel for Microsoft 365 on Windows and apply to a chart’s numeric value axis, such as the vertical axis of a column chart or the horizontal axis of a bar chart.
- Click the chart, then click the value-axis labels you want to change. If you select the wrong chart element, click again on an axis label or use the chart element selection controls.
- Right-click the selected axis and choose Format Axis. This opens the Format Axis pane.
- In the pane, open Axis Options if needed, then expand Number.
- In Format Code, enter
#,##0,,"M"or your preferred variation. Choose Add to apply the custom format. - Check the chart labels and the Linked to source setting. If the chart keeps using the source cells’ format, clear Linked to source before applying the axis code.
Some Excel builds show the number-format controls in a slightly different position within the pane, but the key is to select the axis itself and use its Number settings. If Format Axis shows no Number section, confirm that you selected a numeric value axis rather than a chart title, legend, or another element.
Format data labels instead of the axis
Axis labels and data labels are separate chart elements. Formatting the axis changes tick labels such as 0M, 5M, and 10M. It does not necessarily change the numbers printed beside individual columns, points, or bars. To format those labels, select a data label in the chart, right-click, and choose Format Data Labels. In the pane, open Label Options, expand Number, enter the custom code, and choose Add if shown.
For example, a chart might use a million-scaled axis while its data labels still show full values such as 1,250,000. Applying 0.0,,"M" to the data labels can make them read 1.3M instead. Whether that rounding is useful depends on the audience and the size of the differences. Do not assume that changing a worksheet cell’s number format will always override a chart’s own label settings.
When a data label is selected, make sure you have selected the labels for the intended series, not just one label or the whole chart. Excel can format a single point differently from its series, which may create an inconsistent-looking chart.
Choose between number formats and display units
A custom number format is useful when you want a compact suffix such as M or a particular number of decimal places. Excel also offers a chart-axis Display units setting. Select the value axis, open Format Axis, and under Axis Options choose Millions from Display units. Excel scales the axis display without changing the data values.
These approaches solve related but not identical presentation problems:
- Choose a custom format when you want explicit labels such as 1.2M, need a currency symbol, or want control over decimal places.
- Choose Display units when you mainly want the axis scaled to millions and prefer Excel’s built-in unit handling.
- Use both only after checking the result. If the axis is scaled with Display units and the number format also scales by two commas, the labels may be divided twice.
Display units may show a unit label such as Millions on the chart, depending on the chart and settings. A custom format with a literal M makes the suffix part of each number label. If readers could mistake M for a currency or another unit, add a clear axis title or chart subtitle. For instance, “Revenue (USD millions)” is more informative than an unexplained M.
Set decimals, rounding, and negative values
Pick precision based on the chart’s purpose. Whole millions make a large overview easier to scan, but they can hide differences: 1,240,000 and 1,440,000 both display as 1M with #,##0,,"M". One decimal place distinguishes them as 1.2M and 1.4M. Two places may be appropriate when small changes matter, but too many digits can clutter an axis or make estimates look more exact than they are.
Remember that displayed decimals are rounded. A value of 999,999 with 0.0,,"M" can display as 1.0M, even though the original value is below one million. If that boundary could confuse readers, use more precision, revise the chart’s scale, or provide a note that values are rounded.
Custom number formats can also specify positive, negative, and zero sections separated by semicolons. For example, #,##0,,"M";[Red](#,##0,,"M");"-" formats positive values normally, shows negative values in red parentheses, and displays zero as a dash. The four possible sections are positive; negative; zero; and text. This example uses three sections, so text values are not given a separate custom treatment. Use color thoughtfully: a red negative value can carry an unintended warning if color has another meaning in the chart.
Use consistent units across the chart
Apply the same scale to the axis and data labels when both are present, unless there is a deliberate reason not to. A vertical axis marked in millions alongside labels showing raw values can be technically correct but difficult to interpret. The reverse mismatch—an axis with ordinary values and labels with an M suffix—can also look inconsistent.
For charts comparing several series, check that all series use the same underlying unit. A chart comparing dollars with thousands of dollars, for example, needs a deliberate conversion or a clear explanation; a number format alone does not convert one series into another. Likewise, do not apply a millions format to values already stored in millions. If a cell contains 2.5 to represent 2.5 million, scaling it by two commas will make it display as nearly zero at ordinary precision.
For a clear chart, keep the scale visible in context. An axis title such as “Units sold (millions)” or “Sales (millions of dollars)” explains the unit and can be more accessible than relying only on a suffix. In Microsoft 365 for Windows, add one through Chart Design > Add Chart Element > Axis Titles, then select the appropriate axis title to edit it.
Common problems and how to fix them
- The code has no effect: Confirm that the value axis or data labels are selected, not the worksheet cells. In the axis Number settings, clear Linked to source if it is keeping the source format.
- Labels show a strange value: Count the scaling commas. Two trailing commas scale to millions; three scale to billions. Make sure there are no unintended commas after the numeric placeholders.
- The suffix appears as a format symbol or is missing: Put literal text in quotation marks, as in
0.0,,"M". In the Format Code box, type ordinary straight quotation marks around M. - Values appear too small or too large: Check whether the chart’s Display units setting is also scaling the axis. Avoid applying the millions scaling twice.
- The chart does not offer the expected controls: Check the selected chart element and chart type. A category axis, chart title, or legend has different formatting options from a numeric value axis.
Excel for Mac has comparable chart formatting controls, though the pane layout and labels can differ by release. Excel for the web also has a different interface and may not expose every desktop chart-formatting control in the same way. If you cannot find a custom Format Code box in your version, open the workbook in Excel for Microsoft 365 on Windows or Mac and apply the format there.
Frequently Asked Questions
What is the Excel format code for millions?
Use #,##0,,"M" for whole millions or 0.0,,"M" for one decimal place. Apply it to the chart axis or data labels, depending on which numbers should change appearance.
Does a chart format code change the actual value?
No. It changes the displayed number, not the value stored in the worksheet or the number used in chart calculations. A value of 2,000,000 remains 2,000,000 even if its label reads 2M.
How do I show billions instead of millions?
Use three trailing scaling commas because each one divides the display by 1,000. For example, 0.0,,,"B" can show 1,250,000,000 as 1.3B.
Can I show millions with a currency symbol?
Yes. For a dollar-style display, use $#,##0,,"M" for whole millions or $0.0,,"M" for one decimal place. Confirm that the currency symbol is appropriate for the workbook’s locale and audience.
Why does 999,999 display as 1.0M?
The format rounds the scaled result to one decimal place. Since 999,999 is 0.999999 million, rounding it to one decimal produces 1.0M. Increase the displayed precision or use a different scale if that rounding would mislead readers.
Quick rule for choosing a format
For a clean overview, start with #,##0,,"M". Add one decimal place when rounding would hide meaningful differences, and use a currency symbol or an axis title when the unit needs explanation. Apply the format to the chart element readers actually see, then inspect the finished chart for double scaling, inconsistent labels, and rounding near one million.
Related
- How to Make a Custom Sorting List in Excel
- How to Strikethrough Numbers in Excel: Steps and Tips
- How to Make Serial Numbers in Excel: 4 Easy Methods
Try it: the Percentage Formula Generator: percent of, percent change, increase and decrease, with the formula.
More in Charts & pivot tables
- Combo Bar Chart in Excel: Create, Format, and Fix ItTo make a combo chart in Excel, select your data, choose Insert > Recommended Charts > All Charts…
- Google Sheets Pivot Table Formatting: A Practical GuideTo format a pivot table in Google Sheets, click a cell in the table and use the toolbar…
- Excel Pie Chart Zero Labels: What Happens and How to Fix ItUsually, an Excel pie chart has no visible slice for a value of zero, so its label may…
- Excel Gantt Chart Scrolling Increment and Setup GuideIn Excel, a Gantt chart does not have a built-in scrolling-increment setting. To move a timeline by a…
- Excel Chart Overlay: How to Plot Two Data Sets TogetherYes. In Excel for Microsoft 365 on Windows, you can overlay two data sets by adding both as…
- Excel Bar Graph Grouping: Create Clustered BarsTo group bars in Excel, arrange each group as a separate data series, select the category labels and…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.