count with the number of cells by that equal a target by summing the range.

p4nny

Board Regular
Joined
Jan 13, 2015
Messages
246
Hi,

In my example, I'm trying to create a formula that would return the "numbers of customers making up 80% of revenue".

I want to sum accounts cumulatively until the target is reached "80%") (or the closest match) and count how many accounts this is.

Many thanks for your help, Anthony

Column A Column B
TOTAL SALES 812,559.27
80% of TOTAL SALES 650,047.42
NUMBER OF ACCOUNTS MAKING 80% OF TOTAL SALES????
Account 2014 Net Sales
P2063001 292,575.82
P2568001 110,493.34
P1790003 100,088.84
P1790004 94,744.40
P1126001 86,057.82
P2744002 53,009.23
P1790006 44,677.92
P0973000 18,881.50
P1790008 11,578.72
P2676002 610.08
P1790000- 158.40

<colgroup><col><col></colgroup><tbody>
</tbody>
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
I think you need to specify one more criteria:

Minimum number of accounts making 80%......

or

Maximum number of acounts making 80%.......

As you could get multiple answers to your question.
 
Upvote 0
Thanks for your reply.. I think minimum would be best.

Using the $650k as a target, cumulatively sum the values in each account until the $650k is achieved and return the number of accounts that make up the £650k.
 
Upvote 0
I think this will work, it will return the number at which the cumulative sum is closest to the 80% value.

Your data must be sorted in descending order.


Excel 2010
AB
1TOTAL SALES812,559.27
280% of TOTAL SALES650,047.42
3NUMBER OF ACCOUNTS MAKING 80% OF TOTAL SALES5
4
5
6Account2014 Net Sales
7P2063001292,575.82
8P2568001110,493.34
9P1790003100,088.84
10P179000494,744.40
11P112600186,057.82
12P274400253,009.23
13P179000644,677.92
14P097300018,881.50
15P179000811,578.72
16P2676002610.08
17P1790000-158.4
Trade History
Cell Formulas
RangeFormula
B3{=MATCH(MIN(ABS((MMULT(N(TRANSPOSE(ROW(B7:B17))<=ROW(B7:B17)),B7:B17)-B2))),ABS((MMULT(N(TRANSPOSE(ROW(B7:B17))<=ROW(B7:B17)),B7:B17)-B2)),0)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
WOW! Many thanks...

There appears to be one limitation though.. The data I sent is just a cut of the original. If I increase the range so from B17 to B100 (changing all of the B17 to B100) for example, the formula does not work. It works with the range up to B50.

Thanks again
 
Upvote 0
It worked for me:


Excel 2010
AB
1TOTAL SALES4,882,521.27
280% of TOTAL SALES3,906,017.02
3NUMBER OF ACCOUNTS MAKING 80% OF TOTAL SALES50
4
5
6Account2014 Net Sales
7P2063001292,575.82
8P2568001110,493.34
9P1790003100,088.84
10P179000397823
11P256800197611
12P256800197375
13P267600296874
14P206300196850
15P179000494,744.40
16P179000693921
17P267600291398
18P179000390219
19P256800189574
20P179000686227
21P112600186,057.82
22P206300182245
23P112600181698
24P179000481393
25P179000878876
26P267600277243
27P274400277046
28P179000076740
29P112600176268
30P179000675858
31P274400275486
32P267600275015
33P179000374490
34P097300073470
35P274400273396
36P179000369688
37P179000367515
38P267600267038
39P179000065325
40P179000864053
41P256800163925
42P112600163882
43P274400262268
44P267600259800
45P112600159063
46P179000457846
47P274400256890
48P256800156404
49P274400256150
50P112600153043
51P274400253,009.23
52P206300149688
53P179000848221
54P179000647321
55P097300046714
56P206300146483
57P112600145410
58P256800145003
59P097300044902
60P179000644,677.92
61P097300044441
62P256800143134
63P206300138453
64P256800138170
65P179000836823
66P179000436518
67P097300030446
68P179000629492
69P267600228392
70P179000427609
71P274400227552
72P179000026770
73P179000825964
74P179000424763
75P112600124215
76P179000622228
77P179000320874
78P179000420502
79P097300019348
80P097300018,881.50
81P274400218656
82P179000018542
83P179000016438
84P097300016386
85P179000416155
86P206300115857
87P206300112688
88P179000311800
89P179000811,578.72
90P179000011093
91P179000310744
92P179000010596
93P17900049163
94P11260017606
95P17900087050
96P20630014669
97P17900082532
98P2676002610.08
99P1790006565
100P1790000-158.4
Trade History
Cell Formulas
RangeFormula
B1=SUM(B7:B100)
B2=B1*0.8
B3{=MATCH(MIN(ABS((MMULT(N(TRANSPOSE(ROW(B7:B100))<=ROW(B7:B100)),B7:B100)-B2))),ABS((MMULT(N(TRANSPOSE(ROW(B7:B100))<=ROW(B7:B100)),B7:B100)-B2)),0)}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,937
Members
449,195
Latest member
Stevenciu

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