+ Reply to Thread
Results 1 to 11 of 11

AVERAGEIF formula question

  1. #1
    Registered User
    Join Date
    05-26-2017
    Location
    Kentucky
    MS-Off Ver
    2013
    Posts
    3

    Question AVERAGEIF formula question

    Hi!
    I am trying to figure this formula out. I am currently running this formula:

    =AVERAGE('Therapy Pool'!AQ151,'Therapy Pool'!AD151,'Therapy Pool'!Q151,'Therapy Pool'!D151)

    But, I would really like it to be :
    =AVERAGEIF('Therapy Pool'!AQ151,'Therapy Pool'!AD151,'Therapy Pool'!Q151,'Therapy Pool'!D151,"<>0")

    hoping it would average these non-adjacent columns, and ignoring the zeros.

    However, when I enter that, I get an error. I am using this to populate date from the fields as listed from one page, onto another.

    Thanks!
    Pat

  2. #2
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    696

    Re: AVERAGEIF formula question

    Assume you have the below information and you need to do average of values where the date is 1-Jan-2017 and value should be >0.

    Date Value
    1-Jan-17 14
    1-Jan-17 0
    1-Jan-17 27
    1-Jan-17 14
    1-Jan-17 16
    2-Jan-17 13
    3-Jan-17 30
    4-Jan-17 18
    5-Jan-17 12
    1-Jan-17 20
    1-Jan-17 28
    8-Jan-17 11

    =AVERAGEIFS(B:B,A:A,$A$2,B:B,"<>0")
    Result: 19.83

    =AVERAGEIF(A2:A13,$A$2,B2:B13)
    Result: 17

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: AVERAGEIF formula question

    Since your data are in non-contiguous cells, that approach will NOT work. In the attached sheet, you can see the following formula:

    =SUM(C3,E3,G3,I3,K3)/INDEX(FREQUENCY((C3,E3,G3,I3,K3),0),2)

    Doing exactly what you want. Adjust the ranges to suit your own sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIF formula question

    ...alternatively you could use a Pivot Table and filter out the zero values.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Registered User
    Join Date
    05-26-2017
    Location
    Kentucky
    MS-Off Ver
    2013
    Posts
    3

    Re: AVERAGEIF formula question

    Thank you very much! How would I wrap an IFERROR to display 0.00 instead of #DIV/0!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,428

    Re: AVERAGEIF formula question

    Have a look at posts #3, #4 and #5 here: https://www.excelforum.com/excel-for...xt-record.html
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: AVERAGEIF formula question

    Quote Originally Posted by tdlsaint View Post
    Thank you very much! How would I wrap an IFERROR to display 0.00 instead of #DIV/0!
    If you are referring to the formula from post #3, that would look like this:

    =IFERROR(SUM(C3,E3,G3,I3,K3)/INDEX(FREQUENCY((C3,E3,G3,I3,K3),0),2),0)

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

    Re: AVERAGEIF formula question

    I would look for some kind of identifying key in another row to indicate which columns should be included.
    So instead of saying, do columns D Q AD and AQ
    Say, do the columns that have the word "Amount" in row 1 (or whatever value you can find to use as that key).

    So you can then write
    =AVERAGEIFS('Therapy Pool'D151:AQ151,'Therapy Pool'D1:AQ1,"Amount",'Therapy Pool'D151:AQ151,"<>0")

  9. #9
    Registered User
    Join Date
    05-26-2017
    Location
    Kentucky
    MS-Off Ver
    2013
    Posts
    3

    Re: AVERAGEIF formula question

    Quote Originally Posted by 63falcondude View Post
    If you are referring to the formula from post #3, that would look like this:

    =IFERROR(SUM(C3,E3,G3,I3,K3)/INDEX(FREQUENCY((C3,E3,G3,I3,K3),0),2),0)
    Awesome, thank you very much, I looked at AliGW's suggestions as well and came up with
    =IFERROR(SUM('Therapy Pool'!AQ156,'Therapy Pool'!AD156,'Therapy Pool'!Q156,'Therapy Pool'!D156)/INDEX(FREQUENCY(('Therapy Pool'!AQ156,'Therapy Pool'!AD156,'Therapy Pool'!Q156,'Therapy Pool'!D156),0),2),"")

    So it displays blank.

    Thank you all for your help, it is very much appreciated!

  10. #10
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: AVERAGEIF formula question

    Quote Originally Posted by tdlsaint View Post
    Awesome, thank you very much, I looked at AliGW's suggestions as well and came up with
    =IFERROR(SUM('Therapy Pool'!AQ156,'Therapy Pool'!AD156,'Therapy Pool'!Q156,'Therapy Pool'!D156)/INDEX(FREQUENCY(('Therapy Pool'!AQ156,'Therapy Pool'!AD156,'Therapy Pool'!Q156,'Therapy Pool'!D156),0),2),"")

    So it displays blank.

    Thank you all for your help, it is very much appreciated!
    You're welcome. Glad we could help.

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: AVERAGEIF formula question

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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 formula
    By bennett493 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-10-2017, 10:48 PM
  2. Basic AVERAGEIF/ whatever you suggest question
    By harriboclarke in forum Excel General
    Replies: 1
    Last Post: 11-08-2016, 05:45 PM
  3. Help: Do I use the =AVERAGEIF or other formula?
    By niceguydrp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-13-2014, 09:52 PM
  4. Averageif Function Question
    By Peeekay in forum Excel General
    Replies: 1
    Last Post: 01-25-2012, 09:26 PM
  5. AverageIF Formula in VBA
    By Oqualli in forum Excel General
    Replies: 2
    Last Post: 06-15-2011, 11:13 AM
  6. simple averageif question
    By tannerbabb in forum Excel General
    Replies: 4
    Last Post: 03-31-2011, 12:54 PM
  7. Criteria question - AverageIF (if you please)
    By djalexr in forum Excel General
    Replies: 3
    Last Post: 01-14-2011, 08:00 AM

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