+ Reply to Thread
Results 1 to 8 of 8

Sum only the last four entries

Hybrid View

Dave69rock Sum only the last four entries 01-21-2009, 06:13 AM
sweep Hi, To sum the last four... 01-21-2009, 06:16 AM
Dave69rock Thanks sweep 01-21-2009, 06:35 AM
DonkeyOte Sweep you might want to add... 01-21-2009, 07:17 AM
martindwilson =SUM(INDEX(A1:A52,MAX(1,COUNT(... 01-21-2009, 07:37 AM
DonkeyOte correctamundo... (it was in... 01-21-2009, 07:39 AM
ashwinsindhu sum with 4 different... 10-28-2010, 02:19 PM
NBVC Re: Sum only the last four... 10-28-2010, 02:42 PM
  1. #1
    Forum Contributor
    Join Date
    08-22-2008
    Location
    S-o-t
    MS-Off Ver
    Office 2000 & 2010
    Posts
    166

    Sum only the last four entries

    I have a spreadsheet that i update weekly

    What i need is a formula that will just sum the last four weeks

    Example column A rows 1-52 will be updated each week in row 53 i just want the last four weeks to be summed.

    Dave
    Last edited by Dave69rock; 01-21-2009 at 06:35 AM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    To sum the last four populated rows in column A,

    =SUM(OFFSET(A1,COUNT(A1:A52)-1,0,-4,1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Contributor
    Join Date
    08-22-2008
    Location
    S-o-t
    MS-Off Ver
    Office 2000 & 2010
    Posts
    166
    Thanks sweep

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    Sweep you might want to add some additional logic to your Row offset parameter to handle the fact that you may have less than 4 weeks of data at a given point in time.

    Below is another approach which avoids use of OFFSET (volatile)

    =SUM(INDEX(A1:A52,MAX(1,COUNT(A1:A52)-4),1):A52)

    The use of MAX will ensure you will always get a valid answer.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =SUM(INDEX(A1:A52,MAX(1,COUNT(A1:A52)-3),1):A52)
    else you'd get last 5 values not 4

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    correctamundo...
    (it was in all honesty a typo)

  7. #7
    Registered User
    Join Date
    10-28-2010
    Location
    Decatur, IL
    MS-Off Ver
    Excel 2003
    Posts
    4

    sum with 4 different condition in excel

    Hi could any help me on this formula.

    =SUMPRODUCT((Date>=$B$5)*(Date<=$B$6)*(Productname=$B$7)*(Causingarea=A18)*Downtime)

    Date Product PQVC Causing Area Down Time (Hrs)
    10/20/10 WTS q MISC 1.25
    10/25/10 QCT v MISC 1.25
    10/30/10 QCT v SQ 3.5
    10/30/10 WTS c LPT 1.75
    i am getting #N/A i dont know why. if remove (Productname=$B$7) or )*(Causingarea=A18) i am getting the correct value, can any one help me

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Sum only the last four entries

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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