+ Reply to Thread
Results 1 to 2 of 2

Previous Rows Calculation

  1. #1
    Registered User
    Join Date
    06-30-2010
    Location
    New Mexico
    MS-Off Ver
    Excel 2007
    Posts
    10

    Previous Rows Calculation

    Hello,

    I want to calculate the previous 7 cells, before the formula cell. But my formula cell is changing weekly, so it carriers the previous 7 cells plus the 1 added per week.

    So how can I have a formula that does just a set prevoius number of cells??

    Thank you.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Prevoius Rows Calculation

    It sounds as though you're physically inserting a row between the last prior cell and the formula, correct ?

    And you wish to always sum the last 7 cells irrespective of whether or not new rows are inserted, correct ?

    If so - there are a few options... you could for ex. use OFFSET

    Assume current sum cell is A8:

    =SUM(OFFSET(A8,-1,0,-7,1))
    (you can tweak the height and width if you need to account for possibility of fewer than 7 records to sum)

    Or, you can use INDEX which unlike the above is non Volatile

    =SUM(INDEX(A:A,ROW()-7):INDEX(A:A,ROW()-1))

+ 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