+ Reply to Thread
Results 1 to 8 of 8

AverageiIf for values between a set range

  1. #1
    Registered User
    Join Date
    01-14-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Excel for MS 365
    Posts
    40

    AverageiIf for values between a set range

    I've appreciated all the help I have received in the past on this forum. Looking for help once again!

    I have data of golf shots. I want to report on the average divergence from a target. I don't know how to use AverageIf for an entire dataset when limiting the average to a range between two values (one equal or greater and the other less than).

    In the attached spreadsheet I am looking to solve for the average left/right for a particular golf shot given a target distance. For example, row 14 has a golf shot target that is 52 yards (A14). Column B indicates the left or right variance of the shot. There are a series of shots within the cohort from =>50 yards to <55 yards. If I average their variance it comes out to 1.2 yards. (But, I had to do that manually.

    Any help is greatly appreciated. With that formula determined I can then apply it to the other cells in the report located in cells A1 to H11.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: AverageiIf for values between a set range

    does this work
    =AVERAGEIFS(B14:B33,A14:A33,">="&50,A14:A33,"<"&55)
    or using the cell values
    =AVERAGEIFS($B$14:$B$33,$A$14:$A$33,">="&A2,$A$14:$A$33,"<"&B2)
    get a couple of div errors as the values do not exist
    what do you want to show then
    use an IFERROR(AVERAGEIFS($B$14:$B$33,$A$14:$A$33,">="&A2,$A$14:$A$33,"<"&B2),"what to put here")

    see column I
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,516

    Re: AverageiIf for values between a set range

    Are you still using Excel 2010? If not, please update your forum profile.
    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.

  4. #4
    Registered User
    Join Date
    01-14-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Excel for MS 365
    Posts
    40

    Re: AverageiIf for values between a set range

    Thank you. I have added a new value, Average Yards from Pin. The issue with this is that when I do the AverageIf...it gets skewed by the presence of 0.0 in column D.

    The issue with the highlighted is that it includes the "0.0" values associated with rows 28-33 where there is no data. When no data, the cell calculates to 0.0 and thus is incorporated within the average. How to exclude rows when there is null values in column B and C?

    See attached.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: AverageiIf for values between a set range

    Hehe, there is no Excel 2017.
    It is important that you show the right version for us to give you the best answer.

  6. #6
    Registered User
    Join Date
    01-14-2015
    Location
    Portland, Oregon
    MS-Off Ver
    Excel for MS 365
    Posts
    40

    Re: AverageiIf for values between a set range

    Doh! I see now how to look it up. I’m in Excel for MS 365.

  7. #7
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: AverageiIf for values between a set range

    You could try this.

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

    This formula could be simplified too.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by DJunqueira; 02-26-2024 at 08:22 PM.

  8. #8
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,795

    Re: AverageiIf for values between a set range

    how about
    =IFERROR(AVERAGEIFS($D$14:$D$33,$A$14:$A$33,">="&A2,$A$14:$A$33,"<"&B2,$D$14:$D$33,">"&0),"No Data")

    which excludes zeros in column D , assuming zero is never a valid amount


    =IFERROR(AVERAGEIFS($D$14:$D$33,$A$14:$A$33,">="&A2,$A$14:$A$33,"<"&B2,$C$14:$C$33,"<>"),"No Data")
    That checks column C is not blank

    BUT you say
    How to exclude rows when there is null values in column B and C?
    you say AND will a blank be in both B and C or could B just be blank and you do not want to calculate that row and then another row just C row blank

    can you give an example
    you can just exclude zeros in column D - but will there be zeros which are valid and need to be included
    =IFERROR(AVERAGEIFS($D$14:$D$33,$A$14:$A$33,">="&A2,$A$14:$A$33,"<"&B2,$D$14:$D$33,">"&0),"No Data")

+ 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] Move Values in range to fill blanks in range grab values for column 2 to fill remaining.
    By rose8693 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-14-2023, 05:43 AM
  2. Replies: 1
    Last Post: 12-16-2022, 12:55 PM
  3. [SOLVED] Find and Match values in a range with values in another range and show their position
    By Luisftv in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 10-22-2021, 01:25 AM
  4. [SOLVED] Shift all values in a range until ≤ range of values in array table
    By rtcwlomax in forum Excel Formulas & Functions
    Replies: 18
    Last Post: 07-25-2015, 08:16 AM
  5. Replies: 2
    Last Post: 04-04-2013, 02:12 PM
  6. Replies: 0
    Last Post: 02-22-2011, 01:56 PM
  7. Replies: 11
    Last Post: 05-31-2009, 05:41 PM

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