Hi,
A friend here in the forum helped me with a weighted average code.
Now I'm trying to calculate the weighted average monthly with the following criteria:
When there are 3 or more suppliers for each product in each store per month.
For example:
The weighted average for StoreA Apple product on Jan / 17 when there are 3 or more suppliers:
(each quantity * each unit price) / sum quantity
((33 * 5,00) + (23 * 3,00) + (25 * 3,00) + (27 * 5,00)) / (5,00 + 3,00 + 3,00 + 5,00) must be equal to 4.111111
Then paste this price into the Report worksheet
It includes some lines to make this new criterion, however the code is not calculating, would like to know where I'm going wrong?
I am using the ReDim preserve statement.
Thank you for your attention.
Follow the files for better understanding