+ Reply to Thread
Results 1 to 3 of 3

Average if two criteria matched

  1. #1
    Registered User
    Join Date
    04-07-2009
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Average if two criteria matched

    Hey!

    For example say I have a table array called Cheese, column A is numbers, B is country of origin, and C is Smelly/Not smelly.

    I want to get the average from column A, but only for cheeses that are, say, from England and smelly.

    I've played with sumif/countif but couldn't make it work for two criteria, can anyone help?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Average if two criteria matched

    Given you're using XL2007 you can make use of the new AVERAGEIFS function

    =AVERAGEIFS(A1:A100,B1:B100,"England",C1:C100,"Smelly")

    If you need a backwards compatible version you can use an Average array

    =AVERAGE(IF((B1:B100="England")*(C1:C100="Smelly"),A1:A100))
    confirmed with CTRL + SHIFT + ENTER

    The former if viable is preferable.

  3. #3
    Registered User
    Join Date
    04-07-2009
    Location
    Cambridge, England
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Average if two criteria matched

    Like a charm!

    Thank you. ^.^

+ 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