Calculate top 70% based on total spend

Caly

Board Regular
Joined
Jul 19, 2015
Messages
160
Office Version
  1. 365
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
I have a list of items with associated sales per line. Based on the line of sales and total amount I need to determine which lines represent the top 80%. The formula I’m using does not work when sorting. Need help please.

Formula Used here:Formula Used here:
$357,484.04​
=C5/$C$3=IF(SUM($D$5:D5)<=80%,"Yes","No")
ItemSales% of TotalTop 80% - Yes or No?this formula does not work though when sorting
Product 1
$17,729.16​
4.96%​
YesIF(SUM($D$5:D5)<=80%,"Yes","No")
Product 2
$17,670.50​
4.94%​
Yes
Product 3
$17,637.51​
4.93%​
Yes
Product 4
$17,501.01​
4.90%​
Yes
Product 5
$17,463.34​
4.89%​
Yes
Product 6
$17,433.79​
4.88%​
Yes
Product 7
$17,030.70​
4.76%​
Yes
Product 8
$17,016.03​
4.76%​
Yes
Product 9
$16,858.79​
4.72%​
Yes
Product 10
$16,729.06​
4.68%​
Yes
Product 11
$16,721.44​
4.68%​
Yes
Product 12
$16,483.20​
4.61%​
Yes
Product 13
$16,464.84​
4.61%​
Yes
Product 14
$16,078.88​
4.50%​
Yes
Product 15
$15,361.99​
4.30%​
Yes
Product 16
$15,277.02​
4.27%​
Yes
Product 17
$14,969.15​
4.19%​
Yes
Product 18
$14,882.70​
4.16%​
No
Product 19
$14,774.50​
4.13%​
No
Product 20
$14,607.41​
4.09%​
No
Product 21
$14,556.27​
4.07%​
No
Product 22
$14,236.75​
3.98%​
No
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
This doesn't produce exactly the result you're after (it's not mine, I managed to find it via Google) but it does identify the top results adding up to 80%:

Book2
ABCDEFGH
1
2Formula Used here:Formula Used here:
3$357,484.04=C5/$C$3=IF(SUM($D$5:D5)<=80%,"Yes","No")
4ItemSales% of TotalTop 80% - Yes or No?this formula does not work though when sorting
5Product 1$17,729.164.96%YesIF(SUM($D$5:D5)<=80%,"Yes","No")Product 1$17,729.16
6Product 2$17,670.504.94%YesProduct 2$17,670.50
7Product 3$17,637.514.93%YesProduct 3$17,637.51
8Product 4$17,501.014.90%YesProduct 4$17,501.01
9Product 5$17,463.344.89%YesProduct 5$17,463.34
10Product 6$17,433.794.88%YesProduct 6$17,433.79
11Product 7$17,030.704.76%YesProduct 7$17,030.70
12Product 8$17,016.034.76%YesProduct 8$17,016.03
13Product 9$16,858.794.72%YesProduct 9$16,858.79
14Product 10$16,729.064.68%YesProduct 10$16,729.06
15Product 11$16,721.444.68%YesProduct 11$16,721.44
16Product 12$16,483.204.61%YesProduct 12$16,483.20
17Product 13$16,464.844.61%YesProduct 13$16,464.84
18Product 14$16,078.884.50%YesProduct 14$16,078.88
19Product 15$15,361.994.30%YesProduct 15$15,361.99
20Product 16$15,277.024.27%YesProduct 16$15,277.02
21Product 17$14,969.154.19%YesProduct 17$14,969.15
22Product 18$14,882.704.16%No
23Product 19$14,774.504.13%No
24Product 20$14,607.414.09%No
25Product 21$14,556.274.07%No
26Product 22$14,236.753.98%No
Sheet2
Cell Formulas
RangeFormula
G5:H21G5=INDEX(SORT($B$5:$C$26,2,-1),SEQUENCE(MATCH(TRUE,((MMULT(--(SEQUENCE(1,COUNT($C$5:$C$26))<=SEQUENCE(COUNT($C$5:$C$26))),SORT($C$5:$C$26,,-1))/$C$3)*100)>=79,0)),{1,2})
E5:E26E5=IF(SUM($D$5:D5)<=80%,"Yes","No")
Dynamic array formulas.
 
Upvote 0
Another way ...

Same results as @dreid1011 , plus a variation to include the first value that would make the sum >=80%.

ABCDEFGHI
1
2TOTAL357,48479.6%83.7%
3
4ItemSales
5Product 114,775Product 317,729Product 317,729
6Product 216,483Product 917,671Product 917,671
7Product 317,729Product 1717,638Product 1717,638
8Product 416,465Product 617,501Product 617,501
9Product 514,883Product 2117,463Product 2117,463
10Product 617,501Product 1817,434Product 1817,434
11Product 714,969Product 817,031Product 817,031
12Product 817,031Product 1417,016Product 1417,016
13Product 917,671Product 2216,859Product 2216,859
14Product 1014,607Product 1216,729Product 1216,729
15Product 1114,237Product 2016,721Product 2016,721
16Product 1216,729Product 216,483Product 216,483
17Product 1315,362Product 416,465Product 416,465
18Product 1417,016Product 1516,079Product 1516,079
19Product 1516,079Product 1315,362Product 1315,362
20Product 1615,277Product 1615,277Product 1615,277
21Product 1717,638Product 714,969Product 714,969
22Product 1817,434Product 514,883
23Product 1914,556
24Product 2016,721
25Product 2117,463
26Product 2216,859
27
Sheet1
Cell Formulas
RangeFormula
C2C2=SUM(C5:C26)
F2,I2F2=SUM(F5:F22)/$C2
E5:F21E5=LET(s,SORT(B5:C26,2,-1),m,MATCH(80%*C2,SCAN(,INDEX(s,,2),LAMBDA(a,b,a+b))),TAKE(s,m))
H5:I22H5=LET(s,SORT(B5:C26,2,-1),m,MATCH(TRUE,80%*C2<=SCAN(,INDEX(s,,2),LAMBDA(a,b,a+b)),),TAKE(s,m))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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