+ Reply to Thread
Results 1 to 6 of 6

Averageifs function not returning correct average

  1. #1
    Registered User
    Join Date
    03-02-2017
    Location
    Adelaide, Australia
    MS-Off Ver
    2010
    Posts
    10

    Averageifs function not returning correct average

    I have a scenario where i must determined the average number between an upper and lower bound (Ylower, yupper)

    The upper and lower bounds are calculated separately in the spread sheet and represent the depth of a concrete section. I have a separate array of values which contain all possible section depth.

    I need a function that will return the average value of the section depth between these bounds, noting that often one of the bounds is equal to a value 1.696 which is a constant depth for a significant length of the member.

    I am not sure why this is not working, but when one of the bounds is the 1.696 value (max height) then the average returned in equal to this number. The function appears to be working for my other scenarios.

    I have tried to explain this as clearly as possible but have found it difficult. I have attached the section of the spreadsheet which should be a bit clearer. There is also a pdf explaining the situation.

    Any help would be greatly appreciated, because I have hit a roadblock surfing through the internet for solutions.

    Cam
    Attached Files Attached Files

  2. #2
    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
    44,036

    Re: Averageifs function not returning correct average

    Too many squiggley lines in your PDF.

    What are your criteria for the average? Why are the values from B300 to B423 included in your expected result?

    Incidentally, the formula in J can be simplified considerably:

    =IF(H53=I53,0,AVERAGEIFS(C:C,C:C,">="&MIN(H53,I53),C:C,"<="&MAX(H53,I53)))
    Last edited by Glenn Kennedy; 03-02-2017 at 10:39 PM.
    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

  3. #3
    Registered User
    Join Date
    03-02-2017
    Location
    Adelaide, Australia
    MS-Off Ver
    2010
    Posts
    10

    Re: Averageifs function not returning correct average

    Hi Glenn,

    I am going to put a nominal array of numbers below to try and make it less confusing because the original spreadsheet is not very nice.

    I have 2 x values representing the lower and upper bound.

    Bounds (2,7)

    I also have a table full of all possible x values in column A and respective heights in column B as follows:

    Xlower 2
    Xupper 7

    A B
    x y
    1 2
    2 2
    3 2
    4 2.5
    5 3
    6 4
    7 5
    8 4
    9 3.5

    I need my function to find the corresponding y value that relates to the upper and lower bound (2 and 5 respectively). I then need to find the average of the y values that exist between these two numbers.
    The average calculation manually would become: Yave=(B2+B3+B4+B5+B6+B7)/6 or (2+2+2.5+3+4+5)/6.

    What I have currently done is the following:

    -Use vlook up to calculate the corresponding y value for x=2 and x=7, (2 and 5)
    -I have then used averageifs of the full range of values in column B between 2 and 5.

    I hope this has made it simpler for you. Thanks for your help!

  4. #4
    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
    44,036

    Re: Averageifs function not returning correct average

    As in this sheet?

    =AVERAGEIFS(B:B,A:A,">="&E2,A:A,"<="&E3)
    Attached Files Attached Files

  5. #5
    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
    44,036

    Re: Averageifs function not returning correct average

    On your original sheet, you were including values in your EXPECTED answer that were outside the range 1.37 to 1.6958 (B300 to B420)

  6. #6
    Registered User
    Join Date
    03-02-2017
    Location
    Adelaide, Australia
    MS-Off Ver
    2010
    Posts
    10

    Re: Averageifs function not returning correct average

    That makes sense! That is what I am after.

    Thank you very much for your help.

+ 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. Need help with averageifs function - keeps returning #DIV/0
    By JAWilliams in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-26-2015, 01:38 AM
  2. Percentile Function is not returning correct results
    By walters in forum Excel General
    Replies: 1
    Last Post: 03-10-2015, 10:52 AM
  3. [SOLVED] IF Comparison Function Not Returning Correct Data
    By emlit in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-24-2014, 01:44 PM
  4. Indirect function not returning correct value
    By iamskippy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-16-2013, 04:28 PM
  5. [SOLVED] Is AVERAGEIFS the correct function to use?
    By IrrepressibleXL in forum Excel General
    Replies: 7
    Last Post: 03-27-2012, 07:28 PM
  6. Using AVERAGEIFS function to average a smaller subset of criteria data
    By RJS5062 in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 03-22-2012, 04:19 PM
  7. [SOLVED] MAX Function not returning correct value
    By Phil in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-28-2006, 05:20 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