adding K or M to number

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,640
Office Version
  1. 365
Platform
  1. Windows
Hi
I want to add K or M to numbers, for example 1000 i want it this way 1K and 1000000 i want it 1M.
So for 1K I did this custom formatting

#; \K

It did work find in the number is 1000 and above but if the number is less than 1000 then excel will put K. Is it possible to remove K when the number is less than 1000?
 

Some videos you may like

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

AhoyNC

Well-known Member
Joined
Oct 10, 2011
Messages
4,719
Office Version
  1. 365
Platform
  1. Windows
Maybe something like this in custom formatting.
Code:
 [>=1000000]#.0,"M";[>=1000]#.0,"k";#
 

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,640
Office Version
  1. 365
Platform
  1. Windows
Thank you all for the help. Now I understand the code but I now have a question about these 3 parts. I know this synatax

positive ; negative ; zero ; text

why excel use your code for +ve numbers only, i thought your second part [>=1000]#.0,"k"
should be used for -ve numbers?

 

Watch MrExcel Video

Forum statistics

Threads
1,122,721
Messages
5,597,752
Members
414,171
Latest member
12Rev79

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top