I have a data set as the below simple example which is product code sales value for year
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"]Yr 1 Sales[/TD]
[TD="width: 64"]Yr 2 Sales[/TD]
[TD="width: 64"]Yr 2 Cum[/TD]
[TD="width: 64"]Cumulative %[/TD]
[/TR]
[TR]
[TD]Prod A[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="class: xl63, align: right"]36%[/TD]
[/TR]
[TR]
[TD]Prod B[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]90[/TD]
[TD="class: xl63, align: right"]64%[/TD]
[/TR]
[TR]
[TD]Prod C[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]120[/TD]
[TD="class: xl63, align: right"]86%[/TD]
[/TR]
[TR]
[TD]Prod D[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]140[/TD]
[TD="class: xl63, align: right"]100%[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD="align: right"]115[/TD]
[TD="align: right"]140[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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
[TABLE="width: 320"]
<colgroup><col width="64" span="5" style="width:48pt"> </colgroup><tbody>[TR]
[TD="width: 64"][/TD]
[TD="width: 64"]Yr 1 Sales[/TD]
[TD="width: 64"]Yr 2 Sales[/TD]
[TD="width: 64"]Yr 2 Cum[/TD]
[TD="width: 64"]Cumulative %[/TD]
[/TR]
[TR]
[TD]Prod A[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]50[/TD]
[TD="class: xl63, align: right"]36%[/TD]
[/TR]
[TR]
[TD]Prod B[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]90[/TD]
[TD="class: xl63, align: right"]64%[/TD]
[/TR]
[TR]
[TD]Prod C[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]120[/TD]
[TD="class: xl63, align: right"]86%[/TD]
[/TR]
[TR]
[TD]Prod D[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]140[/TD]
[TD="class: xl63, align: right"]100%[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD="align: right"]115[/TD]
[TD="align: right"]140[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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