VBA helps calculate average

Tocix

New Member
Joined
Apr 17, 2016
Messages
39
Office Version
  1. 365
I have hundreds of lines for which I need to find the average percent based on shift and date. Column A-L Column A contains the shift date, column F contains the average, and column I contain the score. If shift and date are the same on rows 2 and 3, the VBA code for average on cells I2 and I3 is on F 2. Please help with vba code that will do them all for the entire sheet.

AEFI
DateShiftAverageScore
1/24/23184%65.5%
1/24/231101.4%
1/24/23251.9%51.9%
1/23/23170.8%65.4%
1/23/23176.1%
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
In F2 and filled down, try:
Excel Formula:
=IF(COUNTIFS($A$2:A2,A2,$E$2:E2,E2)=1,AVERAGEIFS(I:I,A:A,A2,E:E,E2),"")
 
Upvote 0

Forum statistics

Threads
1,213,562
Messages
6,114,322
Members
448,564
Latest member
ED38

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