+ Reply to Thread
Results 1 to 5 of 5

How to sum range based on condition

  1. #1
    Registered User
    Join Date
    02-11-2011
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2016
    Posts
    83

    How to sum range based on condition

    Hello Friends,

    Please see example file attached example sum until true.xlsx

    Suppose we have this data:

    Number1 Number2 Number3 Condition
    0 0 0 TRUE
    0 0 0
    FALSE
    0 0 0 TRUE
    1 0 0 FALSE
    0 0 0 TRUE
    1 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE
    1 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE
    0 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE
    1 0 0 TRUE

    In additional column I need to sum up range of data, but only until next TRUE CONDITION. IT SHOULD LOOK LIKE THIS:

    0 0 0 TRUE 0
    0 0 0 FALSE
    0 0 0 TRUE 1
    1 0 0 FALSE
    0 0 0 TRUE 1
    1 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE 2
    1 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE 1
    0 0 0 FALSE
    1 0 0 FALSE
    0 0 0 TRUE 0
    1 0 0 TRUE 1

    I can't figure out a clever way using functions to do it. I hope You will understand, even if I can't explain it very properly.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: How to sum range based on condition

    Your explanation on the sheet does not match your expected results."In other words - how to sum up a range of cells between two TRUES

    So the second TRUE would return0, not 1.
    The last TRUE should return 1 but there is nothing between the two last TRUES ?
    "

  3. #3
    Registered User
    Join Date
    02-11-2011
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2016
    Posts
    83

    Re: How to sum range based on condition

    Please let me give another example, this time it is more accurate:

    ABC TRUE [here sum ABC DEF]
    DEF FALSE
    GHI TRUE [here sum GHI JKL MNO PQR]
    JKL FALSE
    MNO FALSE
    PQR FALSE
    STU TRUE [here sum STU]
    VWX TRUE [here sum VWX]

  4. #4
    Registered User
    Join Date
    02-11-2011
    Location
    Vilnius, Lithuania
    MS-Off Ver
    Excel 2016
    Posts
    83

    Re: How to sum range based on condition

    Never mind, figured out myself. Used NESTED IF

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: How to sum range based on condition

    It would be nice if you would share your solution with us. Thank you

+ 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. How would you set up a dynamic range based on this condition
    By unnobtanium in forum Excel General
    Replies: 17
    Last Post: 12-11-2014, 01:15 PM
  2. Highlighting a range from A:I based on condition
    By naga in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2014, 04:46 AM
  3. Named Range data based on condition
    By woprsk in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 03:23 AM
  4. [SOLVED] Color cells in Range based on condition.
    By gammaman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2012, 10:27 AM
  5. Copy-Paste range based on condition
    By Link in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2011, 01:10 PM
  6. VBA for adding borders to a range based on condition?
    By antonymiller in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-17-2009, 10:39 PM
  7. Replies: 2
    Last Post: 01-29-2006, 09:10 PM

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