Categorize by percentage add up to 80%(15%+65%) and 20%(14%+6%) of sales

hpares

New Member
Joined
Feb 22, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi,
Need help to create a code for :
Item | price | sales qty | percentage of total | formula i need to generate to fill in cell(text)
A 100 2 0.8% RED
A 200 11 7% YELLOW
A 300 50 30% GREEN
A 400 1 0.6% RED
A 500 30 18% LIGHT GREEN
A 600 70 42% GREEN
total sales 164
b 100 2 0.8% RED
b 200 11 7% YELLOW
b 300 50 30% GREEN
b 400 1 0.6% RED
b 500 30 18% LIGHT GREEN
b 600 70 42% GREEN
total sales 164 ( just assume a and B have different sales qty, i just need the percentage)

To determine the color. good sales consist of 80% of sales ( 65% of total 80% will be green, 15% of total 80% will be light green) and 20% of sales will be bad sales ( 14% will be bad and 6% will be terrible)
Rank 1 to 6 ( since got 6 price , but my actually work might have more price, and more item type as well and i need to give each type of item individual 100% (80%good sales and 20% bad sales). So basically, if rank 1 is 42%( not yet reach 65%) it is Green. Even it it is exceed 65%, it is still green because it is rank 1.
For rank 2, depends on rank 1 percentage, it might be green or light green. Since rank 1 not yet fully occupy 65%, in this event, rank 2 also is consider green. But if rank 1 exceed 65% and below 80%, rank 2 have to be light green. For rank 3, if rank 1 + rank 2 > 65%, it have to be light green, but if rank 1 + rank 2 < 65%, rank 3 also will be consider green. But if rank 1, or rank 1 + rank 2 > 80%, rank 3 will no longer become light green, it will become yellow ( since the remaining 20% will be categorize as bad or terrible sales). The last rank will always be red.
To do ranking for each item type, i manage to find a video to do ranking . But i was stuck after that. Thanks.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
The best way that I can think of to do this is to rank with a cumulative percentage in an empty column, then use that as the foundation for a set of conditional formatting rules.
Book12345.xlsm
ABCDEF
1Item price sales qty percentage of total Running Total
2A10021.22%1.83%RED
3A200116.71%8.54%YELLOW
4A3005030.49%57.32%GREEN
5A40010.61%0.61%RED
6A5003018.29%26.83%LIGHT GREEN
7A6007042.68%100.00%GREEN
8totalsales164
9b10021.22%1.83%RED
10b200116.71%8.54%YELLOW
11b3005030.49%57.32%GREEN
12b40010.61%0.61%RED
13b5003018.29%26.83%LIGHT GREEN
14b6007042.68%100.00%GREEN
Sheet13
Cell Formulas
RangeFormula
D9:D14,D2:D7D2=C2*(1/SUMIF(A:A,A2,C:C))
E9:E14,E2:E7E2=SUMIFS(D:D,A:A,A2,D:D,"<="&D2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:D7,A9:D14Expression=$E2<=6%textYES
A2:D7,A9:D14Expression=$E2<=20%textYES
A2:D7,A9:D14Expression=$E2<=35%textYES
A2:D7,A9:D14Expression=$E2<=100%textNO
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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