+ Reply to Thread
Results 1 to 8 of 8

Range as Criteria in Average Ifs

  1. #1
    Registered User
    Join Date
    06-18-2014
    Location
    houston, Texas
    MS-Off Ver
    2010
    Posts
    28

    Range as Criteria in Average Ifs

    Hi

    I have a large data set that goes horizontally with criteria above each row like name, group and generation.

    Then I have average columns for each generation. I want to use averageifs to average selected groups at a time just by changing the input criteria as shown below.

    Is it not possible to have a range as my criteria for averageifs?

    ....................................................................................................................................................................................................................
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Range as Criteria in Average Ifs

    What exactly are you trying to calc here?

    average what, if what = what and what =what?

    I dont get how the "table" in I2:L4 come in to this?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-18-2014
    Location
    houston, Texas
    MS-Off Ver
    2010
    Posts
    28

    Re: Range as Criteria in Average Ifs

    So the I2:L4 are the identifiers for that well. Then below it are the production values for each day.

    I want to be able to use the average if function to say for day 1 average all the wells in generation 1 or 2 or 4, that also are in location 45 or 22.
    Something like that, does that make sense?

    So the table you are asking about is just the information that goes with that production stream. I want to use the inputs on the left side to grab only the ones I want. I am just not sure if average if can use a range of values as a criteria, almost like an or statement (location 35,22,45).

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Range as Criteria in Average Ifs

    OK, try this....
    =SUMPRODUCT(($I$6:$L$23)*--($I$2:$L$2=B7)*--($I$3:$L$3=C7)*--($I$4:$L$4=D7))/COUNT($I$6:$I$23)

    However, If I understand you correctly, none of the criteria *sets* that you have in B7D12 match the variables in I2:L4. So maybe play around with the values and see if this is what you want?

  5. #5
    Registered User
    Join Date
    06-18-2014
    Location
    houston, Texas
    MS-Off Ver
    2010
    Posts
    28

    Re: Range as Criteria in Average Ifs

    Thank you for your help, I tried that and didn't quite work. I dont think I was being clear enough, so I attached another spreadsheet to explain more clearly.

    Thank you so much for your time!

    Averageifs.xlsx

  6. #6
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Range as Criteria in Average Ifs

    Hi,

    the formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    array entered could do the trick.

    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

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

  7. #7
    Registered User
    Join Date
    06-18-2014
    Location
    houston, Texas
    MS-Off Ver
    2010
    Posts
    28

    Re: Range as Criteria in Average Ifs

    Awesome! Worked!!

  8. #8
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Range as Criteria in Average Ifs

    Hi, you're welcome.
    Glad to help you.

+ 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. Average a range while omitting a row because of a certain criteria
    By Lehrer in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 03-28-2014, 04:44 PM
  2. [SOLVED] AVERAGE in range, but only if they meet several criteria
    By demelzaaltitude in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-21-2013, 06:58 PM
  3. Average a range based on criteria
    By D_N_L in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-14-2012, 07:15 AM
  4. Average of numbers within a range meeting certain criteria
    By Domenic in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2005, 07:05 PM
  5. Average of numbers within a range meeting certain criteria
    By Domenic in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 AM

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