Custom number format in Millions - How to remove leading decimal if round

netuser

Active Member
Joined
Jun 19, 2015
Messages
420
Hi,

I have been searching for hours on google and did not found the solution to my issue (all solution are for decimal value, in my case it is just a display not real decimal value). I am using following custom number format to show amounts is millions :

0.#,, "M";-0.#,, "M";"-"

All is working fine if I dont have round number (1,100,000) but for round amount like 1,000,000 it show as 1. M

How to avoid leading orphan decimal point if amount is round ?

Thanks
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Use conditional formatting with the condition =int(a1)=a1 and a number format sans decimal.
 
Upvote 0
This break the decimal value, if I have 1,100,000 it is now rounded to 1 M instead of 1.1 M
 
Last edited:
Upvote 0
Just a thought the above solution (int(a1)=a1 ) can never work as my real value is never a decimal value it is just a display even if 1,100,000 will show 1.1 M with custom format, it is still a value that is always INT
 
Last edited:
Upvote 0
Thanks shg for putting me on right path, I was able to solve my problem by dividing the number by 1 million in conditional formating : =INT((F20)/1000000)=(F20)/1000000
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,285
Members
452,902
Latest member
Knuddeluff

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
Back
Top