+ Reply to Thread
Results 1 to 7 of 7

highest average of 6 continuous values from a row containing much more numbers

  1. #1
    Registered User
    Join Date
    11-22-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    highest average of 6 continuous values from a row containing much more numbers

    Dear all,

    I hope one of you can help me with designing a formula which gives me the highest average of 6 continuous values within a row containing approximately 250 values.

    Thx

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: highest average of 6 continuous values from a row containing much more numbers

    Iwhole range is populated with number, e.g. in a single row A2:IP2 then this formula will give the highest avreage of 6 consecutive

    =MAX(SUBTOTAL(1,OFFSET(A2,,ROW(INDIRECT("1:245")),1,6)))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  3. #3
    Registered User
    Join Date
    11-22-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: highest average of 6 continuous values from a row containing much more numbers

    Thanks daddylonglegs for your help!!

    I would like to do the same trick with data arranged in a column. I guessed I could use a similar formula set up. Nevertheless I can't really figure it out.

    The formula for my previous question became: =(MAX(SUBTOTAL(1,OFFSET(A2,,ROW(INDIRECT("1:257")),1,6))))

    The data in the column which a want to analyse in a similar way is arranged from E8 till E265. I came up with the formula: =(MAX(SUBTOTAL(1,OFFSET(E8,,COLUMN(INDIRECT("8:265")),1,6)))) but then he gives the erro #DIV/0! I guess I went wrong with "8:265".

    Thx again.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: highest average of 6 continuous values from a row containing much more numbers

    check what the arguments of 'offset' mean:

    =(MAX(SUBTOTAL(1,OFFSET(E8,,COLUMN(INDIRECT("8:265")),6,1))))



  5. #5
    Registered User
    Join Date
    11-22-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: highest average of 6 continuous values from a row containing much more numbers

    snb thx for your reply!

    I don't really understand what you mean with: "check what the arguments of 'offset' mean", if you mean the explanation of excell what OFFSET does; returns a reference to a range that is a given number of rows and columns from a given reference. I checked it but then I still don't really get what I have to do/change in my formula (sorry I am not so known with excel and its terms)

    The small change (switching 1 and 6) you did in the formula did not change the out come of my on formula (still #DIV/0!)

    So I guess I do something wrong with OFFSET? Can you explain me about the arguments of OFFSET?

    Thx

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: highest average of 6 continuous values from a row containing much more numbers

    probably

    PHP Code: 
    =MAX(SUBTOTAL(1,OFFSET(E8,row(INDIRECT("1:242")),,6,1))) 
    NB offset has 5 arguments.
    Last edited by snb; 11-23-2011 at 06:46 AM.

  7. #7
    Registered User
    Join Date
    11-22-2011
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: highest average of 6 continuous values from a row containing much more numbers

    Thx daddylonglegs and snp for helping me out! I think found the right formula now.

+ 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