+ Reply to Thread
Results 1 to 8 of 8

count up in Column A until the next non-blank cell in Column C

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    count up in Column A until the next non-blank cell in Column C

    Hello, I'm giving myself a headache and am hoping someone can bail me out...

    I have values in Column A that need to Totaled in Column D when a new value is entered in Column C.

    Attached is a small Excel file of sample data.

    Sample Data.jpg

    In the Sample Data, in cell D11, I would like to return the sum of range A3:A11.
    In the Sample Data, in cell D14, I would like to return the sum of range A12:A14.

    I think I'm dealing with an Offset formula, but am going in circles trying to resolve

    Thank you in advance for your help!!
    Attached Files Attached Files
    Last edited by vh_llc@yahoo.com; 12-02-2016 at 03:07 AM. Reason: Just to mark as solved.

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2013
    Posts
    7,372

    Re: count up in Column A until the next non-blank cell in Column C

    d2
    Please Login or Register  to view this content.
    try this and copy towards down
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2013
    Posts
    7,372

    Re: count up in Column A until the next non-blank cell in Column C

    or
    d2
    Please Login or Register  to view this content.
    try this and copy towards down

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    16,519

    Re: count up in Column A until the next non-blank cell in Column C

    TRy


    in D3 and copy down

    =IF($C3="","",SUM(OFFSET($A$2,MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0),0,ROWS($1:1)+2-MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0)-1)))
    Last edited by JohnTopley; 12-02-2016 at 01:48 AM.

  5. #5
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: count up in Column A until the next non-blank cell in Column C

    JohnTopley: Thank you!! works like a charm...

  6. #6
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: count up in Column A until the next non-blank cell in Column C

    JohnTopley: The formula you provided does work perfectly, but I need help to make a modification. Turns out that numbers less than zero give an incorrect result in column "D". Can the formula be modified to ignore values <0, or treat them as 0?

    For cell D14 in the sample data, the formula:

    =IF($C3="","",SUM(OFFSET($A$2,MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0),0,ROWS($1:1)+2-MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0)-1)))

    should return 415.

    The negative value in cell A12 changes 415 to -1994.

    Thanks for any help you can offer!

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    Waterlooville,England
    MS-Off Ver
    Office 2010
    Posts
    16,519

    Re: count up in Column A until the next non-blank cell in Column C

    Try

    =IF($C3="","",SUMIF(OFFSET($A$2,MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0),0,ROWS($1:1)+2-MATCH(LOOKUP(10^10,$C$2:$C2),$C$2:$C2,0)-1),">0"))

  8. #8
    Registered User
    Join Date
    06-12-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: count up in Column A until the next non-blank cell in Column C

    Thanks John!! Once again you're a lifesaver!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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