Looking for a dynamic summing formula
Looking for a dynamic summing formula
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Looking for a dynamic summing formula

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I am looking for a formula that I can put in a cell such that it will sum each cell above it until it hits an empty cell. However, I am never sure how many numbers there will be in the column or where in the sheet the formula will be placed.
    I think I’m looking for something like: sum(z:a), where z is the cell immediately above the formula and cell a is last cell going up before a blank cell. Can anyone help me out with how to code this?
    Thanks for your time and effort,
    Steve

    SteveD

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Code:
    Function SumStrange(Rng As Range) As Variant
    SumStrange = Application.Sum(Range(Rng.Range("A1"), Rng.Range("A1").End(xlUp)))
    End Function
    I you have in A1:A3, {1;2;3} then you could use this in A4 like

    =SumStrange(A3)

    for a result of 6
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Cool! Thank you very much, this will be a huge time saver!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com