+ Reply to Thread
Results 1 to 4 of 4

Averageif Function in VBA

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Averageif Function in VBA

    Hi guys and gals, I'm trying to calculate the average of a column if another column contains certain text, and of course, I need a macro to do this.

    Here's what I've got so far:


    Please Login or Register  to view this content.


    Please Login or Register  to view this content.

    My VBA skills are limited to hunting and pecking at this point, so your help is appreciated!

  2. #2
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Averageif Function in VBA

    For clarification, I'm trying to spit out the Manager/Supervisor Average in Cell E2 (and then I'll want to spit out the Staff (no direct reports) in E3)

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,181

    Re: Averageif Function in VBA

    Please Login or Register  to view this content.
    The function requires 2 ranges, one for criteria to be tested the other for the values to average.
    You appear to be using the same range for both. Not sure what Min is supposed to be.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    03-19-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Averageif Function in VBA

    Andy, thanks so much. I see exactly what you did and why it works. Awesome work.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1