Maybe its just Friday and my brain is off for the 3 day weekend, but I'm totally struggling with this issue.
I need to sum the values of the units sold, but I can only sum the value up to the total units replaced. Dropping off the lowest values.
So I need to rank the highest unit value and multiply the units sold times that value up to the total units replaced.
[TABLE="width: 415"]
<colgroup><col span="3"><col><col><col></colgroup><tbody>[TR]
[TD]rank[/TD]
[TD]value[/TD]
[TD]units sold[/TD]
[TD]unit value[/TD]
[TD] [/TD]
[TD]units replaced[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]400[/TD]
[TD]2[/TD]
[TD]200[/TD]
[TD] [/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1750[/TD]
[TD]5[/TD]
[TD]350[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1200[/TD]
[TD]1[/TD]
[TD]1200[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]3350[/TD]
[TD] [/TD]
[TD]1750[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]
I need to sum the values of the units sold, but I can only sum the value up to the total units replaced. Dropping off the lowest values.
So I need to rank the highest unit value and multiply the units sold times that value up to the total units replaced.
[TABLE="width: 415"]
<colgroup><col span="3"><col><col><col></colgroup><tbody>[TR]
[TD]rank[/TD]
[TD]value[/TD]
[TD]units sold[/TD]
[TD]unit value[/TD]
[TD] [/TD]
[TD]units replaced[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]400[/TD]
[TD]2[/TD]
[TD]200[/TD]
[TD] [/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1750[/TD]
[TD]5[/TD]
[TD]350[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1200[/TD]
[TD]1[/TD]
[TD]1200[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Total[/TD]
[TD]3350[/TD]
[TD] [/TD]
[TD]1750[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]