+ Reply to Thread
Results 1 to 10 of 10

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

    -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
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    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
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    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
    Please Login or Register  to view this content.
    Is that something you can work with?
    Thanks Ron,

    How to use same example for countif?

  7. #7
    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: Using Averageifs function in excel with multiple condition

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

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    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

  9. #9
    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: 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!

  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
    Please Login or Register  to view this content.
    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.6.0 RC 1