Macro for calculation of multiple averages based on cell content

simontop

New Member
Joined
Jun 7, 2011
Messages
6
Long title but I didn't know how to express it better.

I have a table that contains:
-Employee names in column 1
-Date of performance in column 2
-Result (numerical) of performance in column 3

I need an output that contains:
-one row for each employee
-one column for each month
-average of performance for the employee/month combination in the cells

I would try to solve it like this:
-read employee (X)/month(Y) for the cell in the output table
-loop through all values in column 3
-add to variable A if employee is X and Month is Y
-increase counter (variable B) by 1 for each addition
-calculate average from variables A and B

I don't know if this is practical or too complicated. I don't know yet how to achieve this (I'm working on it).

Any help is greatly appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Forum statistics

Threads
1,222,415
Messages
6,165,894
Members
451,993
Latest member
rowebca

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top