Number Formatting Problem

seguin85

Active Member
Joined
Mar 17, 2015
Messages
278
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have written the following number formatting code for a graph:
[>1000000]$0.00,,"M";[>100000]$0,"K";$0.0,"K"

Where if it is over 1 million it will give two decimal place, if it if over 100,000 it will give 0 decimal places, otherwise it will give 1 decimal place.

I want this because I always want the data labels to be 3 decimal places.

Problem is if a value is 0 it shows up as $0.0K where I would like it to be blank.

Any ideas?
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi,

I have written the following number formatting code for a graph:
[>1000000]$0.00,,"M";[>100000]$0,"K";$0.0,"K"

Where if it is over 1 million it will give two decimal place, if it if over 100,000 it will give 0 decimal places, otherwise it will give 1 decimal place.

I want this because I always want the data labels to be 3 decimal places.

Problem is if a value is 0 it shows up as $0.0K where I would like it to be blank.

Any ideas?
Try:

[>1000000]$0.00,,"M";[>100000]$0,"K";
 
Upvote 0
If the value is greater than 0 but less than 100,000 it also shows up as blank.

I'd like it to show up as $##.#K
 
Upvote 0
If the value is greater than 0 but less than 100,000 it also shows up as blank.

I'd like it to show up as $##.#K
You can apply a Conditional Format over the cells to do that. Select your cells and note what the active cell is, let's say for example purposes that the active cell is A1. Use this Conditional Formatting formula...

=A1=0

and set the format for it as the Custom Format "" (just two quote marks, nothing else). Now, if the value is not 0, your cell's Custom Format will apply, but if the cell value is 0, then the Conditional Formatting's Custom Format will override your cell's Custom Format and display nothing.
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,411
Members
448,894
Latest member
spenstar

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