+ Reply to Thread
Results 1 to 4 of 4

Taking simple averages with variable ranges using multiple criteria

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Taking simple averages with variable ranges using multiple criteria

    Hey everyone,

    I have a file with a list of counties in column A, a list of their respective states in column B and a corresponding value in column C. I am trying to take the averages of the values in column C based upon state and county.

    The problem I am running into is that there are a different number of counties per state and the county names are often repeated. Ideally, the end result would be a formula that gives me county X in state Y with average Z that can be dropped down 10,000+ rows.

    My attempt at this based upon previous feedback on this forum from a related question is the following equation:
    =SUMIF($A$2:$C$7856, A2,$C$2:$C$7856)/COUNTIF($A$2:$C$7856,A2)


    However, this does not filter by state as well so if the name Harrison repeats in both Alabama and Ohio, the equation averages both of the counties.
    Attached is a sample workbook.

    Much appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Taking simple averages with variable ranges using multiple criteria

    Hi

    Try with AVERAGEIFS

    =AVERAGEIFS($C$2:$C$19,$A$2:$A$19,A2,$B$2:$B$19,B2)
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Taking simple averages with variable ranges using multiple criteria

    Haha, did not even think something that simple would work.

    But it did, thanks so much!

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Taking simple averages with variable ranges using multiple criteria

    You are welcome

    Always, siempler.. is better..

+ 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