+ Reply to Thread
Results 1 to 9 of 9

summing from a blank cell upwards to the next blank cell

  1. #1
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    summing from a blank cell upwards to the next blank cell

    Hello,

    I'm trying to create a formula that sums from a specified cell, up the column, until it reaches a blank cell. For example, if I had the following starting in A1

    A1 | 1
    A2 | 2
    A3 | 3
    A4 | {blank}
    A5 | 4
    A6 | 5
    A7 | {blank}
    A8 | 6
    A9 | 7
    A10 | 8
    A11 | 9
    A12 | {blank}

    I would like to have a formula in the B column that can propagate down. When it reaches B4 I would like it to sum A1:A3, when it reaches B7 it should sum A5:A6, when it reaches B12 it should sum A8:11.

    Any ideas?

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: summing from a blank cell upwards to the next blank cell

    Try this in B2:

    =IF(A2="",SUM($A$1:A2)-SUM($B$1:B1),"")

    Copy down.

  3. #3
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: summing from a blank cell upwards to the next blank cell

    Thanks Phuocam!

    That works for what I asked for, but now I realize that I won't be able to adapt it as I would like.

    I want the sheet to list prices in USD in Column A, and in CAD in Column B. In column C I will choose CAD or USD, Column D will then sum the appropriate column (A or B) up to the previous blank cell. I've attached a cells sheet to kinda show what I mean.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,919

    Re: summing from a blank cell upwards to the next blank cell

    In D2:

    =IF(C2="","",SUM(OFFSET($A$1,LOOKUP("zzzzz",$C$1:C1,ROW($C$1:C1)),0+(C2="CAD"),
    LOOKUP("zzzzz",$C$1:C2,ROW($C$1:C2))-LOOKUP("zzzzz",$C$1:C1,ROW($C$1:C1)),1)))

  5. #5
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: summing from a blank cell upwards to the next blank cell

    That worked really well! Thanks.

    If you could just help me understand one thing. What do the "zzzzz" parts of the formula mean?

  6. #6
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: summing from a blank cell upwards to the next blank cell

    Actually, one more point. Playing with the formula I'm noticing a few more ways that I need to adapt it.

    In column C I have more options that just "USD" and "CAD". I can also choose "Visa" or "MasterCard" which adds 5% to the USD number, and "Paid" or "Invoice" which leaves it blank. Is it possible to incorporate these into the formula?

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: summing from a blank cell upwards to the next blank cell

    Try this:

    In D2 then drag down:

    Please Login or Register  to view this content.
    Quang PT

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,481

    Re: summing from a blank cell upwards to the next blank cell

    Opp, I did not notice the paid and invoice.

    Try attachment
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-26-2015
    Location
    Sherwood Park, Canada
    MS-Off Ver
    Home 2011, Work 2016
    Posts
    52

    Re: summing from a blank cell upwards to the next blank cell

    That worked!

    Thank you so much!

+ 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. Calculate differnce between 2 dates, but if 1 date cell is blank leave cell blank
    By Vicious00013 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2014, 11:31 PM
  2. [SOLVED] Concatenate If Blank - remove blank line if first cell is blank
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2014, 02:14 PM
  3. Summing Cells that contain an IF Statement to leave the cell blank if zero
    By sweeteri in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-14-2014, 12:58 PM
  4. Replies: 3
    Last Post: 01-23-2014, 12:19 PM
  5. [SOLVED] Cell referenced in formula has no information displayed (shows blank), return blank cell
    By nunayobinezz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2013, 04:51 PM
  6. Insert Numbers Counting From 1 upwards Until It Reaches A Blank Cell Then Start Again
    By TkdKidSnake in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2013, 02:26 PM
  7. Counting cells upwards until blank then printing, how to do?
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-19-2013, 07:37 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