+ Reply to Thread
Results 1 to 4 of 4

Dynamic averaging based on adjacent column.

Hybrid View

  1. #1
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Question Dynamic averaging based on adjacent column.

    I have previously posted a similar query. This looks same as well, but this is different
    I have a column with random values that are generated my my machinery.
    I should not sort them, because they provide me with the performance graph.
    Lets say i have column "A"
    0
    2
    9
    9.5
    30
    90
    22
    15
    9
    0

    As the max value of this is 90, and its 10% of MAX is 9, which occurs at 3rd and 9 th positions.
    I need to find the average of its adjacent range, with zeros not considered.
    It has to calculate the max value in the column, find 10% of max and do average of adjacent column from the sl. no of first occurrence of 10% value in first column to the sl no of last occurrence of 10% value in first column.

    the exact 10% value may not always exist. 10% of 90 is 9, but if the max value is 94, the 10% would be 9.4 which doesn't exist. then it has to take the nearest available predecessor in that case.
    i get values in decimals mostly and only some of them are perfect integers, thus this consideration goes with it,and also, my range actually is B14:B10013
    i would most probably have the 10% value within the first 50 "non zero" entries and reoccurring somewhere probably within the last 50 "non zero" entries.

    attached sample file stating what i need, illustrated.

    I need this urgently for my project work!
    Attached Files Attached Files

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Dynamic averaging based on adjacent column.

    How about:
    Formula: copy to clipboard
    =SUMIF(B:B,">="&MAX(B:B)*10%,C:C)/COUNTIF(B:B,">="&MAX(B:B)*10%)
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Dynamic averaging based on adjacent column.

    Yeah! I've got a problem with the considered value! In the data gicen below, the
    Max= 18
    10% of Max= 1.8 (doesn't exist in data)
    Nearest available value (Predecessor)= 1.7
    Nearest available value (Successor)= 1.9

    The formula takes 1.9 into consideration and excludes 1.7, but i need it to start from 1.7.
    Including and excluding 1.7 gives a difference of 2 units in the average of my adjacent column (which is a great deal for my data's accuracy)
    it has to start from the nearest predecessor. Yeah if the difference between nearest available predecessor and 10% max value is greater than 1.0000 , then it may well take the successor value.

    0
    0
    0
    0
    0
    0.1
    0.2
    0.5
    0.7
    0.9
    1
    1.2
    1.5
    1.7
    1.9
    2
    4
    5
    6
    8
    10
    18
    10
    8
    6
    5
    4
    2
    1.9
    1.7
    1.4
    1.2
    1
    0.9
    0.7
    0.5
    0.2
    0.1
    0

  4. #4
    Registered User
    Join Date
    10-18-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    67

    Re: Dynamic averaging based on adjacent column.

    This seems to work pretty well as of now, but in case Any issue arises, I will contact. Only problem that may arise is an issue in rounding off the value.
    Thanx a lot OllyXLS.
    I have a few sets of data, and once I try on all of them, and no error arises, I will mark the post solved. As of now thanx a ton.

+ 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] Dynamic averaging based on adjacent column.
    By projectatpel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-19-2013, 12:58 PM
  2. [SOLVED] Dynamic Averaging of column.
    By projectatpel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-25-2013, 11:17 AM
  3. Dynamic Averaging of column.
    By projectatpel in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 10-23-2013, 03:39 PM
  4. VBA Loop for averaging multiple cells adjacent to date criteria column
    By Swampy79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2013, 10:08 PM
  5. Averaging based on different Column
    By corky1111 in forum Excel General
    Replies: 5
    Last Post: 08-12-2011, 02:12 PM

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