I have a dataset which represents in each cell the value of stock per week (rows) for each company (columns), from 1997 to 2014. Under each company name is the stock name of the company Data sample.PNG
For each year starting from 1997, I have created a portfolio composition including 5 groups of stocks (S, M , L , XL, XXL) per year. These groups are different from each other and from year to year
Group.png
My goal is to create a column to calculate for each week the average for each group . The result expected should be like this, 5 columns called S , M , L, XL , XXL and in each cell should be the average per week for the certain group stock
resultPNG.PNG
Is there a formula or using VBA code, that can calculate the average per week for each group?
Bookmarks