Change format of particular Data Label of Pie Chart if condition is satisfied

ibdave18

New Member
Joined
Jun 30, 2015
Messages
4
Hi All,

I am Working with following kind of Data structure.

Category A

ProductSales
P112876
P210987
P4876
P3567

<tbody>
</tbody>

Category B

ProductSales
P178965
P248965
P325874
P4120

<tbody>
</tbody>


I have one Form Combo Box containing list 'Category A, Category B' and I linked this Combo Box to above two data rages using Indirect Function.

for example my Output range is C8:D11 (which is Pie Chart range) and if I select Category A then Category A data will be displayed and if I select Category B then Category B data will be displayed in C8:D11 and so chart will change dynamically.

I want Data Labels in % and Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 etc .

For Category A Data lablels are 51%, 43%, 3%, 2% .
For Category B, Data Labels are 51%, 32%, 17%, 0% (=0.07 which I want to be dispalyed as 0.1 %).

Problem is that I cannot find a way to have dynamic number format for 4th product when A and B Categories are selected.

Is it possible to wright VBA code which checks each data label with conditions like Decimal Places 0 if value>1 and 0.0 format if Value<1, 0.00 if value<0.1 and gives required number format?

Thanks.
 
Last edited:

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,215,641
Messages
6,125,982
Members
449,276
Latest member
surendra75

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