+ Reply to Thread
Results 1 to 12 of 12

AVERAGEIF function for multiple columns.

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    AVERAGEIF function for multiple columns.

    Hello,

    I'm looking to average the numbers contained within 5 different columns if the corresponding cell in a different column is blank.

    Here's what I have currently (with column A being the conditional cells and D:H being what I'm looking to average)

    =AVERAGEIF(A3:A26, "", D3:H26)

    From what I understand, this function only allows me to average a single column. If this is in fact a limitation of excel and not just of my knowledge, is there a different way to calculate the average of D3:H26 when the corresponding cell in column A is blank?

    Thanks for any assistance!

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

    Re: AVERAGEIF function for multiple columns.

    Try this array formula**:

    =AVERAGE(IF(A3:A26="",D3:H26))

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

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: AVERAGEIF function for multiple columns.

    Have you triede/g:

    =AVERAGEIF(A3:C26, "", D3:H26)
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    03-11-2014
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: AVERAGEIF function for multiple columns.

    Thanks for the prompt response!

    What you suggest returns a "True" response in the cell, but does not calculate the average. Is there something else I need to do after the CTRL/SHIFT/ENTER step?

  5. #5
    Registered User
    Join Date
    03-11-2014
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: AVERAGEIF function for multiple columns.

    oeldere,

    I'm only looking to evaluate the presence of data in column A, as column B and C will definitely have data in them. My understanding is that with A3:C26, I'd be evaluating all three columns for data right?

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: AVERAGEIF function for multiple columns.

    =SUMPRODUCT((A3:A26<>"")*(D3:H26))/(5*COUNTA(a3:26))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: AVERAGEIF function for multiple columns.

    Not sure how you got that result!

    Here's a small example:

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    44.2
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    2
    3
    42
    84
    52
    56
    54
    32
    4
    39
    49
    17
    60
    56
    5
    62
    63
    68
    17
    73
    11
    6
    2
    56
    30
    44
    53
    72
    7
    39
    67
    71
    28
    8
    92
    8
    8
    20
    97
    31
    76
    2
    9
    70
    14
    31
    2
    42
    69
    10
    21
    40
    64
    57
    3
    69


    This array formula** entered in A1:

    =AVERAGE(IF(A3:A10="",D3:H10))

    Array formulas are entered differently than a regular formula. After you type in a regular formula you hit the ENTER key. With an array formula you must use a combination of keys. Those keys are the CTRL key, the SHIFT key and the ENTER key. That is, hold down both the CTRL key and the SHIFT key then hit the ENTER key.

    When done properly Excel will enclose the formula in squiggly brackets { }. You can't just type these brackets in, you must use the key combo to produce them. Also, anytime you edit an array formula it must be re-entered as an array using the key combo.

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: AVERAGEIF function for multiple columns.

    ops i made a typo in mine <> instead of =
    =SUMPRODUCT((A3:A10="")*(D3:H10))/(5*(8-COUNTA(A3:A10)))

  9. #9
    Registered User
    Join Date
    03-11-2014
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: AVERAGEIF function for multiple columns.

    Tony Valko and martindwilson,

    Both of your formulas worked perfectly! Thank you very much!

    The only other thing I'd ask is if there is a way to make this calculation not average in the blank cells in D3:H26 as zeros in the result?

    I know this is possible otherwise, but am not sure about within this array?

    Thanks again!

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: AVERAGEIF function for multiple columns.

    =SUMPRODUCT(($A$3:$A$10="")*($D$3:$H$10))/SUMPRODUCT(($A$3:$A$10="")*($D$3:$H$10<>"")) will ignore blanks so if there was a blank in d3 it will sum d3:h3 and divide by 9
    if you want to ignore 0 or blank then change to

    =SUMPRODUCT(($A$3:$A$10="")*($D$3:$H$10))/SUMPRODUCT(($A$3:$A$10="")*($D$3:$H$10<>0))
    Last edited by martindwilson; 03-11-2014 at 05:53 PM.

  11. #11
    Registered User
    Join Date
    03-11-2014
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: AVERAGEIF function for multiple columns.

    Perfect. Thank you very much! I appreciate the quick and helpful assistance!

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

    Re: AVERAGEIF function for multiple columns.

    Quote Originally Posted by thatguytg53 View Post

    The only other thing I'd ask is if there is a way to make this calculation not average in the blank cells in D3:H26 as zeros in the result?
    Sure...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    48
    ----
    ----
    ----
    ----
    ----
    ----
    ----
    2
    3
    42
    84
    52
    56
    54
    32
    4
    39
    49
    56
    5
    62
    63
    68
    17
    73
    11
    6
    2
    56
    30
    44
    53
    72
    7
    39
    67
    71
    28
    8
    92
    8
    8
    20
    97
    31
    76
    2
    9
    70
    14
    31
    2
    42
    69
    10
    21
    40
    64
    57
    3
    69


    This array formula** entered in A1:

    =AVERAGE(IF(A3:A10="",IF(D3:H10<>"",D3:H10)))

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

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] AVERAGEIF Multiple Columns
    By Markvx in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 08-29-2015, 08:48 AM
  2. Averageif multiple columns
    By bronzboy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-27-2013, 03:59 PM
  3. AverageIf of two columns
    By dt32 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 10:47 AM
  4. [SOLVED] Excel 2010 AVERAGEIF function to average two different columns on two different tabs
    By stevemills04 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-05-2013, 01:48 PM
  5. AverageIf based on another columns criteria
    By AllenMead in forum Excel General
    Replies: 7
    Last Post: 09-06-2010, 12:46 PM

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