+ Reply to Thread
Results 1 to 5 of 5

Indicating how many cells to sum up

  1. #1
    Registered User
    Join Date
    08-07-2011
    Location
    america
    MS-Off Ver
    Excel 2003
    Posts
    18

    Indicating how many cells to sum up

    Hello,

    Problem:

    I want to tell excel to sum up 4 cells in a column. But I want to make the number of cells dynamic. In other words, I want to have a empty cell where I type 2 or 3 or 5, and according to what number I typed in that cell, excel goes to a given data and sums up however many cells i indicated on the above cell to sum up.

    Illustration.

    A1= 2
    data is b1:b100
    Since A1 is 2, I want excel to sum up b1:b2. But if A1=4, I want excel to sum up b1:b4.

    THANK YOU
    Last edited by calhawk01; 11-18-2011 at 04:06 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Indicating how many cells to sum up

    Hi Calhawk,

    Perhaps try:

    =SUM(OFFSET(B1,0,0,A1))

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,704

    Re: Indicating how many cells to sum up

    Thanks for editing your thread title, calhawk01,

    another way is to use INDEX

    =SUM(B1:INDEX(B:B,A1))
    Audere est facere

  4. #4
    Registered User
    Join Date
    08-07-2011
    Location
    america
    MS-Off Ver
    Excel 2003
    Posts
    18

    Re: Indicating how many cells to sum up

    No problem Mod! I'm sorry for the mistake. Anyways, thank you paul and mod! both work!!

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Indicating how many cells to sum up

    Hey now.. I'm a Mod too.. that hurts a little.

    Just kidding, glad you have it sorted out.

    Please mark the thread as Solved, thanks. (Click Edit in first post, click Go Advanced, select [SOLVED] from the "Title" drop-down where it says No Prefix, click Save Changes.)

+ 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