+ Reply to Thread
Results 1 to 4 of 4

Average of changing range.

  1. #1
    Registered User
    Join Date
    07-15-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    22

    Average of changing range.

    Hi all,
    I am getting rather frustrated by what seems to be a fairly straight forward task.

    I am wanting to calculate the average of the last 7 entries across a row that will be added to. I have seen many formulas calculating downwards, and I have managed to accomplish this- but the formula needs to be calculating across the row, opposed to down a column and I am definitely missing something!

    Is a Sample of what I am trying to achieve.

    7day Average
    2 3 1 4 5 1 4 5 5



    This is where I last got to before getting too annoyed!
    =AVERAGE(OFFSET(K41,COUNTA(L41:S41)-7,0,7))





    So; the range will be added to, and I am, wanting to calculate the average of the last 7 entries- overwriting the previous one
    There will be no blank fields ( the numbers will run continuously)- but there is other text in the workbook, within that row.


    Any help will be much, much appreciated!!! :D :D :D

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Average of changing range.

    I used a different row to test, but try this...
    =AVERAGE(OFFSET($B$30,,COUNT(30:30)-7,1,COUNT(30:30)))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-15-2016
    Location
    Dublin, Ireland
    MS-Off Ver
    2013
    Posts
    22

    Re: Average of changing range.

    Thank you.
    Actually I had a browse and came to something similar.

    =AVERAGE(OFFSET(C35,0,COUNTA(35:35)-8,1,COUNT(35:35)))

    Will incorporate the $ signs also! thanks!

    For some reason it only equates when I select minus 8... which seems strange? Perhaps something to do with the reference?
    Also, as you say, testing it in a different row. ....SURELY the formula can work in the same row?! (Despite reading the contrary everywhere!)

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,002

    Re: Average of changing range.

    If you want the results in same row ..

    something like ....

    so with formula in A1 or B1 or AAA1

    =AVERAGE(OFFSET($C1,0,COUNTA($C1:ZZ1)-8,1,COUNT($C1:ZZ1)))

+ 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. average ifs with average range in different lines / columns
    By campelliann in forum Excel General
    Replies: 2
    Last Post: 12-23-2015, 07:49 AM
  2. [SOLVED] Changing an Average formula
    By JoeB11 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-21-2015, 07:34 PM
  3. average with changing start and end points
    By puzzlelover22 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2014, 12:28 PM
  4. Replies: 0
    Last Post: 10-22-2013, 01:04 PM
  5. Weighted average of ever changing stock
    By pansovic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-28-2012, 04:27 PM
  6. How Do I Average A Range On A Different Worksheet Then Paste The Average To A Cell
    By Cfallscat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2011, 04:14 AM
  7. Changing average
    By initias in forum Excel General
    Replies: 5
    Last Post: 11-12-2010, 04:47 AM

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