+ Reply to Thread
Results 1 to 6 of 6

Dynamic sum of number of cells

  1. #1
    Registered User
    Join Date
    01-07-2013
    Location
    Denmark
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Dynamic sum of number of cells

    Hi all

    I'm working on a spreadsheet where I would like to be able to sum a certain number of cells automatically. E.g. I put in 120 or 100 in my reference cell and Excel then gives me the sum of the top 120 or 100 cells in my revenue column. Is there a way to do this? I've thought about simply naming the range of cells like "top120revenue" and "top100revenue" etc. but besides being static it is also complicated when working with 27 sheets. If a formula exists it would be easier to simply change the sheet reference instead of relabeling the range of cells.

    Hope someone can help!?
    Last edited by Dennis Foldager; 01-07-2013 at 05:38 AM.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Dynamic sum of number of cells

    Assuming that your numbers starts in A2, and reference cell is C1, then this formula should do this.

    Please Login or Register  to view this content.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: Dynamic sum of number of cells

    hi Dennis Foldager, welcome to the forum. uploading a sample Excel file will enable us to help you better. to upload, press "Go Advanced" beside the "Post Quick Reply" button & click on the paperclip icon
    ideally, it should contain your desired results

    but assuming data is in A2:A121 & your cell reference that contains 120 or 100 is in B1, then:
    =SUM(INDIRECT("A2:A"&B1+1))
    the "+1" is because my data starts from A2.

    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

  4. #4
    Registered User
    Join Date
    01-07-2013
    Location
    Denmark
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Re: Dynamic sum of number of cells

    Thanks for the fast replies! Really appreciate the help.

    I haven't been able to make your suggestions work so I've tried to attach a small sample for you guys

    Once again thanks alot



    Sample.xlsx

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Dynamic sum of number of cells

    In F4 type how many rows you want to count

    In F5, put this formula.

    =SUM(F8:INDEX(F8:F5000,F4))

    Do you have your expected result?

  6. #6
    Registered User
    Join Date
    01-07-2013
    Location
    Denmark
    MS-Off Ver
    Office 365 ProPlus
    Posts
    18

    Re: Dynamic sum of number of cells

    Yes...perfect thanks! Will mark as solved now!

+ 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