+ Reply to Thread
Results 1 to 5 of 5

Sum of last 11 numbers

  1. #1
    Registered User
    Join Date
    10-02-2013
    Location
    Karlovo, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    Sum of last 11 numbers

    Hi,
    I need a formula that calculates the sum of the last 11 numbers in the line. I found a formula but when I add the 12th number for example a refference error message appears. What I need is to add numbers and to sum up the last 11 (from B to L, from C to M, from D to N, etc.). I'm attaching a file:
    Book.xlsx
    I'll appreciate your help.

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Sum of last 11 numbers

    Try

    =SUM(INDEX(B2:Z2,COUNT(B2:Z2)-10):INDEX(B2:Z2,COUNT(B2:Z2)))
    Last edited by Ace_XL; 10-02-2013 at 05:26 AM. Reason: Oversight..it shd be last 11 numbers. thanks benishiryo for pointing out
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: Sum of last 11 numbers

    =sum(index(2:2,1,counta(2:2)-10):index(2:2,1,counta(2:2)))
    Cheers
    Andy
    www.andypope.info

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Sum of last 11 numbers

    welcome to the forum, Kraso. remove the ",1" in your INDEX formula.
    =SUM(INDEX(B2:Z2,MAX(1,COUNT(B2:Z2)-10),1):Z2)
    for your current data, you are saying you want row 1 (obtained from MAX of 1 & COUNT-10) & column 1. it works because COUNT is 11. 11-10 is 1. Max is 1

    but if you have more 1 more data, it becomes MAX of 1 & 2 (12-10). that will give you 2nd row, 1st column. you don't have a 2nd row in your INDEX formula B2:Z2. that gives you REF error

    by omitting the 1, the INDEX guesses that you want it for the column.
    =SUM(INDEX(B2:Z2,MAX(1,COUNT(B2:Z2)-10)):Z2)

    if it confuses you, you can say you want the 1st row but column to change:
    =SUM(INDEX(B2:Z2,1,MAX(1,COUNT(B2:Z2)-10),1):Z2)

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    10-02-2013
    Location
    Karlovo, Bulgaria
    MS-Off Ver
    Excel 2007
    Posts
    4

    Thumbs up Re: Sum of last 11 numbers

    Ace_XL
    Andy Pope
    benishiryo


    Many thanks! I have now 3 working formulas.
    Problem solved.

+ 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. [SOLVED] [SOLVED] Macro/Wildcard to remove only numbers excluding text with numbers
    By indianhp in forum Word Programming / VBA / Macros
    Replies: 6
    Last Post: 06-21-2013, 08:16 AM
  2. [SOLVED] Convert all numbers stored as text or custom formatted to numbers &no decimals - 40 sheets
    By synses in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-19-2013, 01:46 AM
  3. Replies: 8
    Last Post: 11-01-2012, 07:49 PM
  4. [SOLVED] How to merge a numbers from 3 cells, eliminate repetitive numbers, and sort such numbers?
    By david gonzalez in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2012, 11:59 AM
  5. Replies: 0
    Last Post: 08-23-2005, 03:59 AM

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