+ Reply to Thread
Results 1 to 10 of 10

Averaging a column based on boundaries set at a different column

  1. #1
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Averaging a column based on boundaries set at a different column

    Hi all!

    I would like to take the average of a number of data points in a column based on boundaries applied to the column next to it. Sorry for the bad explanation. Please refer to the example to make it understandable:

    example.xlsx

    Cheers,

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Averaging a column based on boundaries set at a different column

    Something like =AVERAGE(INDEX($B$1:$B$16,D1):INDEX($B$1:$B$16,D2)) ?

  3. #3
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Averaging a column based on boundaries set at a different column

    I'm going to check that out. Thanks already!

  4. #4
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Averaging a column based on boundaries set at a different column

    Thanks it works exactly as I meant!Nice!.jpg

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Averaging a column based on boundaries set at a different column

    hi Kybynn, try this as an alternative:
    =AVERAGE(INDIRECT("B"&D1&":B"&D2))

    Pepe's solution is less volatile though

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  6. #6
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Averaging a column based on boundaries set at a different column

    example.xlsxPepe's example wasn't exactly what I meant, therefore I created a new example wherein it is explained better...

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Averaging a column based on boundaries set at a different column

    =average(index($b$1:$b$16,d1):index($b$1:$b$16,d2-1))

    The boundaries in E5 are totally different from the preceding patterns???

  8. #8
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Averaging a column based on boundaries set at a different column

    Heya guys,

    Thanks for the replies, but this is not exactly what I'm looking for.

    example.xlsx

    I tried to explain it better in the example. The idea is to apply the stated boundaries in column D to column A and based on these, retreive the average from column B. Instead of taking the xth row from column B.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Averaging a column based on boundaries set at a different column

    "i.e. for the blue range range only use the values in column B
    when the values in column A are = 11≤x≤15"
    But in your example the rows from 12 to 16 are blue and your average is calculated on the same range?????

  10. #10
    Registered User
    Join Date
    02-22-2012
    Location
    Thailand
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: Averaging a column based on boundaries set at a different column

    Yes because row 12 to 16 of column A are within the specified requirements of 11≤x≤15 i.e. the values of column A of row 12 to 16 (11.2, 11.9, 12, 13.8 and 14.3) are equal to or bigger than 11 and are smaller or equal to 15. Therefore the average is taken of row 12 to row 16 of column B.

    This is exactly what I am trying to do. By the way, sorry that this wasn't clear immediately.

    Cheers or salut or dag!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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