+ Reply to Thread
Results 1 to 3 of 3

Sum values until the first time a condition is met

  1. #1
    Registered User
    Join Date
    09-30-2017
    Location
    USA
    MS-Off Ver
    Office 360
    Posts
    2

    Sum values until the first time a condition is met

    I was able to solve the problem using brute force but my system/Excel seems to struggle when trying to apply it to a large data set. I was wondering if anyone could provide any assistance with solving this problem in a more efficient computational way.

    =IFS(U6<>$U$3,"",AB6=1,(F6-E6)/E6, AB7=1,(F7-E6)/E6, AB8=1,(F8-E6)/E6, AB9=1,(F9-E6)/E6, AB10=1,(F10-E6)/E6, AB11=1,(F11-E6)/E6, AB12=1,(F12-E6)/E6, AB13=1,(F13-E6)/E6, AB14=1,(F14-E6)/E6, AB15=1,(F15-E6)/E6, AB16=1,(F16-E6)/E6, AB17=1,(F17-E6)/E6, AB18=1,(F18-E6)/E6, AB19=1,(F19-E6)/E6, AB20=1,(F20-E6)/E6, AB21=1,(F21-E6)/E6, AB22=1,(F22-E6)/E6, AB23=1,(F23-E6)/E6, AB24=1,(F24-E6)/E6, AB25=1,(F25-E6)/E6, AB26=1,(F26-E6)/E6, AB27=1,(F27-E6)/E6, AB28=1,(F28-E6)/E6, AB29=1,(F29-E6)/E6, AB30=1,(F30-E6)/E6, AB31=1,(F31-E6)/E6, AB32=1,(F32-E6)/E6, AB33=1,(F33-E6)/E6, AB34=1,(F34-E6)/E6, AB35=1,(F35-E6)/E6, AB36=1,(F36-E6)/E6, AB37=1,(F37-E6)/E6, AB38=1,(F38-E6)/E6, AB39=1,(F39-E6)/E6, AB40=1,(F40-E6)/E6, AB41=1,(F41-E6)/E6, AB42=1,(F42-E6)/E6, AB43=1,(F43-E6)/E6, AB44=1,(F44-E6)/E6, AB45=1,(F45-E6)/E6, AB46=1,(F46-E6)/E6, AB47=1,(F47-E6)/E6, AB48=1,(F48-E6)/E6, AB49=1,(F49-E6)/E6, AB50=1,(F50-E6)/E6, AB51=1,(F51-E6)/E6, AB52=1,(F52-E6)/E6, AB53=1,(F53-E6)/E6, AB54=1,(F54-E6)/E6, AB55=1,(F55-E6)/E6, AB56=1,(F56-E6)/E6, AB57=1,(F57-E6)/E6, AB58=1,(F58-E6)/E6, AB59=1,(F59-E6)/E6, AB60=1,(F60-E6)/E6, AB61=1,(F61-E6)/E6, AB62=1,(F62-E6)/E6, AB63=1,(F63-E6)/E6, AB64=1,(F64-E6)/E6, AB65=1,(F65-E6)/E6, AB66=1,(F66-E6)/E6, AB67=1,(F67-E6)/E6, TRUE,(F68-E6)/E6)

    There are two main conditions, the primary one, which if met, #(reference cell) vs 0, then I want sum the number of values from that point until a second condition is met to stop the summing (which will also be a 1 vs 0). In this example, stopping at summing ~62 cells is an arbitrary stop point based on the limitations of IFS function.

    The other issue is that the value to indicate to stop summing can occur multiple times within the possible summing range and I only want to sum until the stop condition is met the first time.

    Thanks in advance.

    Steven

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: Sum values until the first time a condition is met

    Hi Steven and welcome to the forum,

    Yep, you're working too hard...
    See if this kind of formula will work for you in the attached that replaces your formula above...

    =SUM(INDIRECT("A6:"&IFERROR(ADDRESS(6,MATCH(0,$A$6:$S$6,0)),"S6")))

    You will need to modify the start and end letters of the above to fit your data. See the attached with my example.

    Sum to first zero in cell.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-30-2017
    Location
    USA
    MS-Off Ver
    Office 360
    Posts
    2

    Re: Sum values until the first time a condition is met

    MarvinP,

    Thanks for the response. I was able to use what you provided to figure out the solution with some tweaking. I ended up having to use OFFSET function but it all worked out.

    Thanks again for taking your time to help me out.

    Appreciate it!

    Steven

+ 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. Using If-Then condition on time
    By justinmendell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-26-2016, 05:16 PM
  2. [SOLVED] adding values after looking & matching day & time condition from another sheet
    By tabkaz in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-20-2015, 07:51 AM
  3. condition formatting for list of values from key values of appropriate match
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2013, 10:13 PM
  4. compare time values - current time with time in cell range?
    By wyattea in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-13-2013, 11:28 PM
  5. IF condition of Time and Day
    By emina002 in forum Excel General
    Replies: 3
    Last Post: 02-21-2012, 09:52 PM
  6. Store cell values in an array and return values on specific condition
    By gmalpani in forum Excel - New Users/Basics
    Replies: 7
    Last Post: 11-27-2011, 06:43 AM
  7. Replies: 0
    Last Post: 09-30-2010, 11:04 AM

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