+ Reply to Thread
Results 1 to 7 of 7

Adding up the latest 5 number automatically

  1. #1
    Registered User
    Join Date
    07-09-2012
    Location
    Australia
    MS-Off Ver
    Mac Office 2011
    Posts
    13

    Adding up the latest 5 number automatically

    Hi,

    I have a spreadsheet needed to be updated everyday, and I also need to add up the past 5 days number as well.

    Instead of using =sum formula everyday, is there any way I can use the formula to add up the latest 5 numbers (which automatically pick up the new number and don't add up the oldest number), it could save my time everyday.

    Please find the attachment for the example.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding up the latest 5 number automatically

    Will there always be 5 numbers to sum?

    If not, then what should happen?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    07-09-2012
    Location
    Australia
    MS-Off Ver
    Mac Office 2011
    Posts
    13

    Re: Adding up the latest 5 number automatically

    Most of the time there will be 5 numbers to sum.

    But if there has not enough 5 number, say 4 or 3, then just sum up those numbers

    Thanks

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding up the latest 5 number automatically

    Try this...

    =IF(COUNT(A:A),SUM(OFFSET(A1,COUNT(A:A)-1,,MAX(-5,-COUNT(A:A)))),"")

  5. #5
    Registered User
    Join Date
    07-09-2012
    Location
    Australia
    MS-Off Ver
    Mac Office 2011
    Posts
    13

    Re: Adding up the latest 5 number automatically

    Thanks Tony,

    Very helpful

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Adding up the latest 5 number automatically

    or maybe
    =SUM(INDEX(A:A,COUNT(A:A)):INDEX(A:A,MAX(COUNT(A:A)-4,1)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Adding up the latest 5 number automatically

    You're welcome. Thanks for the feedback!

+ 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. Replies: 9
    Last Post: 11-28-2013, 05:20 PM
  2. Lookup Latest number
    By Abrielle in forum Excel General
    Replies: 4
    Last Post: 04-04-2012, 02:58 PM
  3. [SOLVED] automatically place the latest entry from a column into a formula
    By dakotasky in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-05-2006, 05:50 PM
  4. [SOLVED] Scale: Automatically included latest data
    By Jack Hairston in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-27-2006, 11:30 AM
  5. [SOLVED] Latest Modification Date Automatically Printed
    By Pedro in forum Excel General
    Replies: 1
    Last Post: 02-10-2006, 04:00 PM

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