Multiple Cumulative %'s

Ed_Global

New Member
Joined
Jul 11, 2017
Messages
12
I have a data set as the below simple example which is product code sales value for year

Yr 1 SalesYr 2 SalesYr 2 CumCumulative %
Prod A35505036%
Prod B55409064%
Prod C03012086%
Prod D2520140100%
Total115140

<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>
</tbody>

It has been sorted to be largest to smallest sales for the second year. I then have a cumulative sales calculation field and the cumulative sales % column also (cumulative sales/total sales).

The cumulative % figure then drives a logic statement to classify the products (important to less important).

I want to also know the same info for year 1 but based on the largest product for year 1 to the smallest product for year 1. Is there a way to do this with rank or some other formula? My only way at present is to copy the dataset then resort it based on year 1 then do the cumulative sum and % calculations. But as I have 5 years sales I'll end up with 5 data sets then which is a bit messy. Any ideas?

Regards

Ed
 

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.
I think this might help.

Copy the formulas in Row2 down to Row5, and the one in B6 across.

[Note that I'm not implying ColumnA has the correct product for the figures in Columns D through G.]


Book1
ABCDEFG
1PruductYr1 SalesYr2 SalesYr 1 CumYr1 Cum%Yr2 CumYr2 Cum%
2Prod A35505548%5036%
3Prod B55403578%4064%
4Prod C03025100%3086%
5Prod D25200100%20100%
6Total115140115140
Sheet58
Cell Formulas
RangeFormula
D2=AGGREGATE(14,6,B$2:B$5,ROWS(D$2:D2))
E2=SUM(D$2:D2)/D$6
F2=AGGREGATE(14,6,C$2:C$5,ROWS(F$2:F2))
G2=SUM(F$2:F2)/F$6
B6=SUM(B2:B5)
 
Last edited:
Upvote 0
Hi!

Maybe the formulas below can helps.

In G2 and copy down - Array Formula - use Ctrl+Shift+Enter to enter the formula

=INDEX($A$2:$A$5,MATCH(LARGE(INDEX($B$2:$F$5,,CEILING(COLUMNS($G2:G2),2)/2)-ROW($A$2:$A$5)/10^9,ROWS(G$2:G2)),
INDEX($B$2:$F$5,,CEILING(COLUMNS($G2:G2),2)/2)-ROW(A$2:A$5)/10^9,0))


In H2 and copy down - Normal Formula - use only Enter to enter the formula

=SUMPRODUCT(LARGE(INDEX($B$2:$F$5,,CEILING(COLUMNS($H2:H2),2)/2),ROW(H$2:H2)-ROW(H$2)+1))/
INDEX($B$7:$F$7,CEILING(COLUMNS($H2:H2),2)/2)


After that, copy the range G2:H5 to the right until the column P.


ABCDEFGHIJKLMNOPQ
1Yr 1 SalesYr 2 SalesYr 3 SalesYr 4 SalesYr 5 SalesProductYr 1 SalesProductYr 2 SalesProductYr 3 SalesProductYr 4 SalesProductYr 5 Sales
2Prod A355077840Prod B32%Prod A36%Prod A33%Prod C37%Prod D45%
3Prod B5530494935Prod C65%Prod C64%Prod D57%Prod D69%Prod A69%
4Prod C5540516717Prod A85%Prod B86%Prod C79%Prod B96%Prod B90%
5Prod D2520535874Prod D100%Prod D100%Prod B100%Prod A100%Prod C100%
6
7Total170140230182166
8
**********************************************************************************************************************************************

<tbody>
</tbody>


I hope that this helps.

Markmzz
 
Upvote 0
Hi again!

If you want only the % (no matter the order of the products), then try the formula below:

In G2 and copy down and to the right

=SUMPRODUCT(LARGE(B$2:B$5,ROW(G$2:G2)-ROW(G$2)+1))/B$7

I hope that this helps too.

Markmzz
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,537
Members
449,088
Latest member
RandomExceller01

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