+ Reply to Thread
Results 1 to 5 of 5

=Averageif help

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    =Averageif help

    First, thank you for the great help I always get on here.

    I would like to average the values in row 7 if the value in row 8 is dog or horse.

    I was trying =AVERAGEIF(A8:C8,"dog,cat",A7:C7)

    Is there a way to do this?

    Thanks again

    sample.xls

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =Averageif help

    Try

    =SUM(SUMIF(A8:C8,{"dog","horse"},A7:C7))/SUM(COUNTIF(A8:C8,{"dog","horse"}))


    FYI, you have a trailing space after dog in A8

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: =Averageif help

    THANKS! That worked perfect and if I want to add additional conditions it is easy to do so.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =Averageif help

    Great, glad to help.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: =Averageif help

    Here's another one...

    Array entered**:

    =AVERAGE(IF(A8:C8={"dog";"horse"},A7:C7))


    You would be better off using cells to hold the criteria:

    A1 = dog
    A2 = horse

    Array entered**

    =AVERAGE(IF(A8:C8=A1:A2,A7:C7))


    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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