Format Numbers in Millions (M) & Thousands (K) in Excel

To show Excel numbers in thousands or millions, select the cells, press Ctrl+1, choose Custom and type #,##0,"K" for thousands or #,##0.0,,"M" for millions. Each trailing comma divides the displayed number by 1,000, so 23,600,000 shows as 23.6M. Only the display changes. The real value stays in the cell, so your formulas, charts and pivot tables still work.

In this guide you’ll get copy-paste format codes for K, M and B, a way to switch automatically between K and M, how to handle negatives and small numbers, the TEXT function alternative, and what to do in charts and pivot tables.

Large numbers showing as K and M in an Excel chart
Large numbers showing in K or M in Excel

Quick reference: custom format codes for K, M and B

Type any of these into Format Cells > Number > Custom > Type. The examples use 23,614,500 (and 2,350,000,000 for billions).

What you want Format code Shows as
Thousands, with K #,##0,"K" 23,615K
Millions, whole numbers #,##0,,"M" 24M
Millions, 1 decimal #,##0.0,,"M" 23.6M
Millions, 2 decimals #,##0.00,,"M" 23.61M
Billions, 1 decimal #,##0.0,,,"B" 2.4B (for 2,350,000,000)
Dollar prefix $#,##0.0,,"M" $23.6M
Millions with no letter #,##0.0,, 23.6
Lower-case m 0.0,,"m" 23.6m

The rule: one comma after the digit placeholders = thousands, two = millions, three = billions. The text in quotation marks is just a label.

How to display numbers in thousands (K) in Excel

  1. Select the cell or range you want to change.
  2. Press Ctrl+1 (Mac: Cmd+1 or Ctrl+1) to open Format Cells. You can also right-click and choose Format Cells, or use the small arrow in the Number group on the Home tab.
  3. On the Number tab, click Custom.
  4. In the Type box, replace General with:
    #,##0,"K"
  5. Click OK. 23,000 now shows as 23K.
Custom Number Format popup in Microsoft Excel
The Custom number format box in Excel

If you type 0, "K" with a space before the quotation mark, you get a space in the result (“23 K”). Leave the space out for “23K”.

How to display numbers in millions (M) in Excel

  1. Select the numbers and press Ctrl+1.
  2. Choose Custom.
  3. Type this in the Type box:
    #,##0.0,,"M"
  4. Click OK. 23,600,000 now shows as 23.6M.

Use 0,,"M" if you want whole millions only (24M), or add more zeros after the decimal point for more detail. Excel rounds the display, not the value, so 23,614,500 shown as 23.6M is still 23,614,500 in the formula bar.

Show K for thousands and M for millions automatically

If one column mixes small and large numbers, a single code gives awkward results (4,500 shows as 0.0M). A conditional format fixes that by choosing the unit for each cell:

[>=1000000]#,##0.0,,"M";[>=1000]#,##0.0,"K";0

Excel checks the conditions from left to right. Values of 1 million or more show in M, values from 1,000 up show in K, and anything smaller shows as a plain number. So 2,350,000 becomes 2.4M, 8,400 becomes 8.4K and 650 stays 650.

To add billions, use this version:

[>=1000000000]#,##0.0,,,"B";[>=1000000]#,##0.0,,"M";#,##0.0,"K"

Here everything below 1 million falls into the K section, so 650 shows as 0.7K.

Two limits to know about. First, a custom format allows at most two conditions plus a final “everything else” section. That is why this stops at B, M and K. Second, negative numbers do not meet >= conditions, so they fall into the last section and are not scaled the way you expect. If your data has big negatives, use Conditional Formatting with separate rules, which has no two-condition limit.

Format negative numbers and small values

A custom format can hold up to four sections, separated by semicolons: positive, negative, zero and text. To show negative millions in red brackets:

#,##0.0,,"M";[Red](#,##0.0,,"M");0

Now -23,600,000 shows as (23.6M) in red, and zero shows as plain 0.

For small values, use 0 rather than # as the last placeholder before the commas. With #,,"M", a value of 400,000 displays as just “M” because the # hides the zero. With 0.0,,"M", it shows 0.4M.

Use the TEXT function instead (and when not to)

If you need the result as text inside another cell, such as a chart title or a sentence, use TEXT:

=TEXT(A2,"#,##0.0,,")&"M"

For thousands, use =TEXT(A2,"#,##0,")&"K". You can also divide first: =TEXT(A2/1000000,"0.0")&"M".

Microsoft notes that TEXT always returns text, not a number, which makes it harder to use in later calculations. So keep your original numbers in one column, and use TEXT only in a separate “label” cell. For ordinary reports, a custom number format is the better choice because the cell stays a number.

Actually converting to thousands or millions (not just display)

Sometimes you want the cell value itself to change, for example to turn 23,600,000 into 23.6 before exporting. A number format will not do that. Instead:

  1. Type 1000000 (or 1000) in an empty cell and copy it.
  2. Select your numbers, then choose Paste Special > Values > Divide.

Or use a formula such as =A2/1000000. To go from millions to thousands, multiply by 1,000 instead. Label the column “in millions” so nobody misreads it.

Show K and M in charts and pivot tables

Pivot tables. Right-click a value, choose Value Field Settings > Number Format > Custom and paste the same format code. The pivot then keeps the format when you refresh or rearrange it. New to pivots? See our Excel pivot table tutorial.

Charts. A chart normally follows the format of its source cells, so the K or M format carries across to axis labels and data labels. If it does not, open Format Axis (or Format Data Labels), go to Number, pick Custom, paste your code and untick Linked to source if it is ticked. Value axes also have a Display Units setting (Hundreds, Thousands, Millions and more) that removes the zeros and adds a label such as “Millions”. For more chart ideas, see creating beautiful Excel charts for business presentations.

Excel for Mac and Excel for the web

  • Mac: Format Cells opens with Cmd+1 or Ctrl+1, and the Custom codes above work the same way.
  • Excel for the web: custom format support in the browser is more limited than in the desktop app. If you cannot find the Custom option, use Open in Excel to open the workbook in the desktop app and apply the format there.
  • Versions: Microsoft’s custom number format article covers Excel for Microsoft 365, 2024, 2021, 2019 and 2016.

Handy for this and many other tasks: our list of Microsoft Excel shortcuts.

Common mistakes and troubleshooting

  • The number shows as “M” only, or as 0M. The value is under 1 million. Use 0.0,,"M" with a decimal, or the K/M conditional format above.
  • Quotation marks missing. Always put the letter in double quotes. An unquoted M can be read as a month or minute code, and Excel may reject or change your format.
  • Curly “smart” quotes. If you paste a code from a web page or Word and it fails, retype the quotation marks in Excel.
  • It shows ######. The column is too narrow. Widen it, or reduce the decimal places.
  • Totals look off by 0.1. The cells are rounded for display only. A visible 23.6M + 12.4M may total 36.1M because the hidden digits are still added.
  • Nothing changed. The “number” may be text. Check whether it is left-aligned, then convert it to a real number first.
  • Want to remove the format? Select the cells and choose General in the Number Format box on the Home tab.

Download the practice file

Try each format on real numbers: Number_formatting_in_K_or_M.xlsx. It has a few scenarios for converting large numbers into thousands or millions.

Frequently Asked Questions

How do I format numbers in millions in Excel?

Select the cells, press Ctrl+1, choose Custom and enter #,##0.0,,"M". The two commas divide the display by one million and the quoted M is added as a label. The cell value does not change.

What custom format turns 1,000,000 into 1M?

Use 0,,"M". The two commas scale the display by one million, so 1,000,000 shows as 1M and 2,500,000 shows as 3M. For 2.5M instead, use 0.0,,"M". It is a custom number format, not a formula, so the cell keeps its full value.

How do I add M to numbers in Excel?

Use a custom number format with the letter in quotation marks, such as 0,,"M". Do not type the M into the cell, because that turns the number into text. If you only need the M in a formula result, use =TEXT(A2,"0.0,,")&"M".

How do I show numbers in thousands (K) in Excel?

Use #,##0,"K". One comma scales the display by 1,000, so 23,000 appears as 23K.

How do I show $M or $K in Excel?

Add the dollar sign at the start of the format: $#,##0.0,,"M" gives $23.6M and $#,##0,"K" gives $23K.

How do I convert thousands to millions in Excel?

If the numbers are already in thousands, divide by 1,000 with a formula or Paste Special > Divide to get millions. If they are in full units and you only want them to look like millions, use the two-comma format.

How do I show millions with two decimals?

Use #,##0.00,,"M". Add or remove zeros after the decimal point to change the precision, or use the Increase Decimal button on the Home tab.

Does the custom format change the actual value?

No. It changes only how the number looks. Formulas, sorting and charts use the full original value, which you can see in the formula bar.

Can I show K, M and B in the same column?

Yes, with a conditional format such as [>=1000000000]#,##0.0,,,"B";[>=1000000]#,##0.0,,"M";#,##0.0,"K". Excel allows two conditions plus a default section.

Want to get faster and more confident in Excel?

Our video lessons take you from the basics to formatting, formulas and pivot tables, at your own pace. See the Excel for Beginners course, or browse all ExcelChamp courses.

Next, try how to learn advanced Excel fast. Spend more time analysing your numbers, and less time counting zeros.

Solving Everyday Problems in Excel [Survey]

Each week I receive questions from people facing issues with Excel. Some need help on Excel Formulas, Pivot Tables or Macros.

What issues are you facing in Excel?
[wwm_survey id=”0″]

Thanks. This will help me to create more useful Excel Tips and Tricks, that will address the issues you face with Excel.

Are you facing any problem in using Excel? Any Question?

You have come to the right place. Tell us your needs. We’ll be glad to help you!


Cheers,
Vinai Prakash

Extracting Text From Variable Length Strings

After I wrote about how to extract characters from the left, right or middle of a text string in Excel, I received a few inquiries about extracting text from strings which don’t seem to have a fixed size, and vary in length.

For example, if the data is something like this

HQ-1022-PORT
LONDON-4053-LANDED
HOUSTON-2488-WEST
SINGAPORE-3133-LEEDON

You want to separate out the first word (HQ, LONDON, HOUSTON, SINGAPORE etc.)

Can’t Use LEFT Function
You can’t use a LEFT function, because a left function needs to know the number of characters you want to extract. And this itself is variable… There are 2 characters in HQ, 6 in London, 7 in Houston etc.

One of the ways I have discovered is to find the location of the first Hyphen (-), and extract all characters from the left of it.

Want to Improve Your Excel Skills?

Learn the Key Features of Excel Quickly & Easily, by Joining the
Online Training on Basic / Intermediate Excel.

To Get Most out of Excel, Learn the  Pivot Table techniques in our
Pivot Table Masterclass Training
!


Finding the location of the First Hyphen
We can use the FIND function to find the location of the first hyphen.

If A2 contains HQ-1022-PORT, we can use the formula as:

=FIND(“-“,A2)

The answer would be 3. This means that the hyphen is the third character in the string. This is perfect. Now we know that we need n-1, that means 3-1, which is 2. We need 2 characters from the Left of this number.

So we can write another formula as

=LEFT(A2,  FIND(“-“,A2)-1 )

The resulting answer would be HQ. Copy the formula down to other cells, and you should be able to extract HOUSTON, SINGAPORE etc. without much hassle, and without having to write another, different formula.

One size fits all formula to extract a variable length string from a piece of text. And pretty easily too!

Do you have any other method? How would you solve this challenge?

Please post your answers in the comments below.

Cheers,
Vinai Prakash

P.S. – I am teaching a 2 day course on Data Interpretation & Analysis in Singapore on Feb 9-10, 2015, and another on March 9-10, 2015. If you would like to learn techniques to analyze data and create management reports, you can attend this program.

Awaiting you and your innovative comments below … 🙂 – Vinai

Are you facing any problem in using Excel? Any Question?

You have come to the right place. Tell us your needs. We’ll be glad to help you!

New, Free, Excel Pivot Table Training For You

Want to learn more about Excel Pivot Tables to Analyze Business Data?

I am in the process of completing a short, free online training on Pivot Tables (8 Lessons are already available online). The course is being published by Udemy, an online training portal.

This course is called Mastering Pivot Tables to Analyze Business Data in Excel 2010 / 2013.

I have recorded 8 lessons so far. They are:

  1. What is a Pivot table?
  2. Formatting a Pivot table
  3. Customizing a Pivot table to Get it Ready for Data Analysis
  4. Adding Sub Totals in a Pivot Table
  5. Sorting Pivot Table data in multiple ways
  6. Filtering Pivot data in Unique ways
  7. Creating New Calculations in Pivot Tables
  8. Analyze data with Percentages in Excel.

Do check it out, and give me some feedback about this business data analysis with Excel training .

Want to Improve Your Excel Skills?

Learn the Key Features of Excel Quickly & Easily, by Joining the
Online Training on Basic / Intermediate Excel.

To Get Most out of Excel, Learn the  Pivot Table techniques in our
Pivot Table Masterclass Training
!


I need specific help with these 2 questions:

  1. What other topics would you like to be covered in this Pivot table mastery training.
  2. What can be improved in this Pivot Table training video?
  3. How would you rate this training, on a scale of 1-5 (1 is lowest, 5 is highest)

If you have any other feedback, simply post it at the bottom of this post. I will surely appreciate it.

And thanks to all my supporters, friends, and family, who have given me the strength, feedback, and waited patiently while I recorded these Excel training video sessions.

Cheers & All the Best – Vinai Prakash

Are you facing any problem in using Excel? Any Question?

You have come to the right place. Tell us your needs. We’ll be glad to help you!

Quick Tip: Re-Sorting a List or Table in Excel

Of course you know how to sort data in Excel! Simply click on the Sort button, or click on the mini A-Z or Z-A chicklet buttons, and voila! the list is sorted. And if you want more control, you can try Custom Sorting, and Advanced Sorting with this Method.

The problem is that a sorted list often gets out of sync, if you keep adding or editing data in the table. And if you use a Custom Sorting sequence, you can’t simply click on the single column sorting chicklets any longer  🙁

So you have to go to Custom Sort, and click it again to get the list sorted one more time.

Want to Improve Your Excel Skills?

Learn the Key Features of Excel Quickly & Easily, by Joining the
Online Training on Basic / Intermediate Excel.

To Get Most out of Excel, Learn the  Pivot Table techniques in our
Pivot Table Masterclass Training
!


A Quick Way to Sort Your Custom Sorted Table in Excel
Fortunately, there is a quicker and shorter way. All you need to do is to click on the Reapply button, which shows up once you click on the Sort menu on the Home Tab.

Reapply Sorting in Excel
Reapply Sorting in Excel

There’s a shortcut – Ctrl + Alt + L

This makes the current list or table sorted again. Even if you had multiple columns in the custom sorted list.

What I have done is to put this Reapply button on my Quick Access Toolbar in Excel. This makes it much snappier to apply it anytime, anywhere in Excel.

Reapply Sorting Button in the Quick Access Toolbar
Reapply Sorting Button in the Quick Access Toolbar

Hope you like this quick tip. It has saved me quite a few clicks, and a lot of time searching for something in a not so sorted table…

Cheers,
Vinai Prakash

PS: Check out how to sort in a unique manner – not ascending , not descending. Sorting it Your Way!

Also, let me know if there is anything in Excel that bothers you…. anything where you could get some help. Simply post it into a comment or email it to me, and I’ll see what I can do to help you out 🙂 – Vinai

Are you facing any problem in using Excel? Any Question?

You have come to the right place. Tell us your needs. We’ll be glad to help you!