+ Reply to Thread
Results 1 to 5 of 5

Average range of cells in column if values in adjacent column are equal

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    DC
    MS-Off Ver
    Excel 14.2.2 for Mac 2011
    Posts
    2

    Average range of cells in column if values in adjacent column are equal

    Hi all,

    Having trouble figuring out how to put together this macro. Essentially, I have three columns (and, predictably, about 20,000 rows, so I don't want to do this by hand). The first two columns each contain a word, and the third contains a numeric value, and it looks something like this:

    Please Login or Register  to view this content.
    The A column isn't really important at this point. What I need is a macro that looks through column B, and average all the numbers in column C for each unique value of B. That is, 0 20 and 17 will all be averaged for arch. Bottle will be the average of just that one value, and so on. The problem is the highly variable numbers for every column B value. There are some that have 20-30 repetitions, and others only 1. I have had a hard time figuring out a way to do this. Any ideas?

  2. #2
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Average range of cells in column if values in adjacent column are equal

    First sort by column B, then use the SubTotal functionality of Excel and select from the dropdown box that at each change in Column B use the function average and add subtotal to column C checking the Summary below data check box. See File attached
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    DC
    MS-Off Ver
    Excel 14.2.2 for Mac 2011
    Posts
    2

    Re: Average range of cells in column if values in adjacent column are equal

    Wow, thank you! I have been using Excel for years and I never knew it had that function. Think of all the hours that could have been saved, heh. Anyway, thanks a lot!

  4. #4
    Forum Contributor
    Join Date
    05-04-2012
    Location
    Stamford,Connecticut,USA
    MS-Off Ver
    Excel 2003
    Posts
    105

    Re: Average range of cells in column if values in adjacent column are equal

    You are welcome.
    Don't forget to click on the Star below the posting to show your appreciation for the help received and mark the posting as solved.

  5. #5
    Registered User
    Join Date
    11-02-2012
    Location
    nc
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Average range of cells in column if values in adjacent column are equal

    I'm looking for a function similar, but I can't add a subtotal row. I need to do it as a column. For example,if I have in column A 2063.....2065..2083....so on, and i want to average the hours for each product listed but just limit it to the individual product, is there an match average function i can use? Or index average?

+ 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