I am trying to calculate a weighted-average in Excel for unstructured data and stay compact (without adding a lookup table to work with). The data structured the following way and I am not allowed to change it.
I am sure that volume (weighting factor) will always be earlier in the dataset than price (value to average). I am also sure that data is sorted as demonstrated on the picture
Do you think there is a way to calculate weighted-average for one product in one line? I have already tried array formulas, but can't match values that should be multiplied within arrays: volumes with prices.
Text version of data is as follows:
product;customer;parameter;Jan;Feb;Mar
product 1;customer 1;volume;69;75;98
product 1;customer 1;price;97;32;96
product 1;customer 1;other parameter;71;31;50
product 1;customer 1;other parameter;2;1;79
product 1;customer 1;other parameter;74;93;67
product 1;customer 2;volume;59;74;94
product 1;customer 2;other parameter;0;73;67
product 1;customer 2;price;40;38;89
product 1;customer 2;other parameter;29;44;86
product 1;customer 3;other parameter;85;30;7
product 1;customer 3;volume;34;72;7
product 1;customer 3;price;35;46;33
product 2;customer 4;volume;87;81;64
product 2;customer 4;price;21;65;94
product 2;customer 4;other parameter;78;68;36
product 2;customer 4;other parameter;33;27;47
product 2;customer 4;other parameter;66;57;53
product 2;customer 1;volume;42;70;22
product 2;customer 1;other parameter;7;88;21
product 2;customer 1;price;43;58;80
product 2;customer 1;other parameter;27;51;48
product 1;;weighted-average price;63.2283950617284;38.5701357466063;90.4773869346734
product 2;;weighted-average price;28.1627906976744;61.7549668874172;90.4186046511628