VBA Code for Average and count

OVSD_DS

New Member
Joined
Jul 22, 2024
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
I have a spreadsheet that I would like to use as VBA Code to look at the worksheet and below every person count give me an Average, sometime the person will have 6 line items and sometimes it will have 3 or 2 also on the bottom of the average I will like to have how many time the count is higher than the Average. is this possible with a VBA code


name08/21 Count
Alvarez30
Alvarez32
Alvarez33
Alvarez32
Alvarez32
Alvarez33
Average--->
count of how many times >
Armstrong27
Armstrong28
Armstrong26
Armstrong28
Armstrong25
Average--->
Arredondo6
Arredondo6
Average--->
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I like VBA and use it all the time. In this case though, why don't you create a separate table that summarizes those values. I would do it like this
Book2
ABCDEFG
18/21/2024
2NameCountDateAverageCount over Avg
3Alvarez308/21/2024Alvarez322
4Alvarez328/21/2024Armstrong26.83
5Alvarez338/21/2024Arredondo60
6Alvarez328/21/2024
7Alvarez328/21/2024
8Alvarez338/21/2024
9Armstrong278/21/2024
10Armstrong288/21/2024
11Armstrong268/21/2024
12Armstrong288/21/2024
13Armstrong258/21/2024
14Arredondo68/21/2024
15Arredondo68/21/2024
Sheet1
Cell Formulas
RangeFormula
E3:E5E3=UNIQUE(A3:A15)
F3:F5F3=AVERAGEIFS($B$3:$B$15,$A$3:$A$15,$E3,$C$3:$C$15,F$1)
G3:G5G3=COUNTIFS($A$3:$A$15,$E3,$C$3:$C$15,F$1,$B$3:$B$15,">"&F3)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,841
Members
452,948
Latest member
UsmanAli786

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