Display same amount of values when narrowing a column

crowds40

New Member
Joined
Mar 12, 2017
Messages
17
Hi,

I hope my question isn't too complicated. So say in my column A I have:

blue
red
green
yellow
green
yellow
yellow
blue
...

Say in the end I have:
50 blue, 20 red, 100 green, and 180 yellow

If I am narrowing down the my amount of rows to just 100. How do I make it:
27 blue, 20 red, 27 green, 27 yellow
(I understand this is 101 which is fine or it could be 26 blue, 20 red, 27 green, 27 yellow so it uses the highest amounts to make it 100 if its easier to make a formula or macro)

Note that these amount will change each time I use excel. So next time I could start with:
15 blue, 30 red, 120 green, 200 yellow.

Again narrowing the amount to 100:
15 blue, 28 red, 28 green, 28 yellow (this equals 99, but to be 100 it could be 15 blue, 28 red, 28 green, 29 yellow)

So I would need a formula or macro which could display the same amount of colors, even if one of the colors is less then the average, to equal 100 total colors.
I hope this makes sense. I can try to explain further. Please help. Thank you.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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