+ Reply to Thread
Results 1 to 10 of 10

Thread: Using Averageifs function in excel with multiple condition

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    12

    Using Averageifs function in excel with multiple condition

    Gurus,

    I need to average a column say B:B (with dollars) only if Column A:A contains either A or B or E. Any help will be highly appreciate.

    Regards,

    Xenos

  2. #2
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,297

    Re: Using Averageifs function in excel with multiple condition

    Hi

    I am not a Guru..but you can try, something like this.

    =IF(COUNTIF(A:A;"A")+COUNTIF(A:A;"B")+COUNTIF(A:A;"C")>0;AVERAGE(B:B);"")

    Hope to helps you
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    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.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  3. #3
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,711

    Re: Using Averageifs function in excel with multiple condition

    This regular formula averages the Col_B cells where the corresponding Col_A cell equals any of a, b, or e
    C1: =SUM(SUMIF(A:A,"="&{"a","b","e"},B:B))/SUM(COUNTIF(A:A,"="&{"a","b","e"}))
    Is that something you can work with?
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    01-28-2011
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Using Averageifs function in excel with multiple condition

    Thanks for the prompt reply but after using your formula the answer is not coming correct.

  5. #5
    Registered User
    Join Date
    01-28-2011
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Using Averageifs function in excel with multiple condition

    Thanks for the prompt reply but after using your formula the answer is not coming correct

  6. #6
    Registered User
    Join Date
    01-28-2011
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Using Averageifs function in excel with multiple condition

    Quote Originally Posted by Ron Coderre View Post
    This regular formula averages the Col_B cells where the corresponding Col_A cell equals any of a, b, or e
    C1: =SUM(SUMIF(A:A,"="&{"a","b","e"},B:B))/SUM(COUNTIF(A:A,"="&{"a","b","e"}))
    Is that something you can work with?
    Thanks Ron,

    How to use same example for countif?

  7. #7
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,297

    Re: Using Averageifs function in excel with multiple condition

    ..An example is here..
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    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.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  8. #8
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,711

    Re: Using Averageifs function in excel with multiple condition

    Quote Originally Posted by xenos14 View Post
    Thanks Ron,

    How to use same example for countif?
    In this part of the formula I posted:
    SUM(COUNTIF(A:A,"="&{"a","b","e"}))

    This section: "="&{"a","b","e"}
    resolves to these three distinct criteria:
    ="a"
    ="b"
    ="e"
    (The braces {} define the beginning and end of the array of values)

    Consequently, this: SUM(COUNTIF(A:A,"="&{"a","b","e"}))
    is equivalent to this:
    SUM(COUNTIF(A:A,="a"),COUNTIF(A:A,="b"),COUNTIF(A:A,="e"))

    I hope that helps
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  9. #9
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,297

    Re: Using Averageifs function in excel with multiple condition

    Consequently, this: SUM(COUNTIF(A:A,"="&{"a","b","e"}))
    is equivalent to this:
    SUM(COUNTIF(A:A,="a"),COUNTIF(A:A,="b"),COUNTIF(A:A,="e"))
    Thanks Ron

    First time see this...

    I dIdn't knew this!
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    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.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  10. #10
    Registered User
    Join Date
    02-19-2012
    Location
    Tasmania, Australia
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Using Averageifs function in excel with multiple condition

    Quote Originally Posted by Ron Coderre View Post
    This regular formula averages the Col_B cells where the corresponding Col_A cell equals any of a, b, or e
    C1: =SUM(SUMIF(A:A,"="&{"a","b","e"},B:B))/SUM(COUNTIF(A:A,"="&{"a","b","e"}))
    Can this be done while excluding cells that are blank?
    Also can the conditions "a", "b", "e" be a reference to another cell?

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.2.0