Custom format to display one or no decimal places (stray period!)

  • Thread starter Thread starter Legacy 181763
  • Start date Start date
L

Legacy 181763

Guest
Please can anyone tell me how (or if!) I can use the custom format option to display numbers as percentages to either 1 or 0 decimal places:

Example 1: Value in cell 0.29449, Required display 29.4%
Example 2: Value in cell 0.29, Required display 29% (my major issue is that the closest I can get results in it displaying "29%." i.e. a final stray period remains on the end!

My specific situation is that I have a stacked bar chart in Excel which comprises a number of series, each corresponding to a percentage value. I wish to add data labels which are of the form #0.x% (where x would not equal zero) or #0% (otherwise). e.g. four series, with the values 0.294, 0.3, 0.045, 0.7 would result in data labels on the chart as follows 29.4%, 30%, 4.5%, 70%

Many thanks!

A
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi, welcome to the board.

I don't think you can do that, at least not easily.
I think your choices are
29.4% 30.0% 4.5% 70.0%
OR
29% 30% 5% 70%
and so on.

You could manually edit the format for each label, but that might be a pain.
You might be able to get a macro to do it as well.
 
Upvote 0
I've tried this without much success in the past - sorry I don't have a contribution this time, but I'd be interested to see if anyone else has.
 
Upvote 0
Reference your percentages in another range, and multiple by 100. Then change the number format to be Custom of:
General"%"
and use that range for your chart.

Excel Workbook
ABCD
129.4%30.0%4.5%70.0%
2
329.4%30%4.5%70%
Sheet15
 
Upvote 0
Doesn't that kind of ignore the 1 DP issue for numbers like 0.2449?
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,835
Members
452,947
Latest member
Gerry_F

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