+ Reply to Thread
Results 1 to 7 of 7

Summing Values after Finding Max Consecutive Values

  1. #1
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Summing Values after Finding Max Consecutive Values

    Hi,

    How are you?

    If you can please help me, I'd be very appreciative.

    I have 10 columns (A-J). Column B is the Date & Column C is the Time, I have the data sorted 1st by date then by time. The 5th Column, E, is Size. The 10th column, J, is "Position."

    This 10th column, J, is in binary format. A 1 equals a Position & a 0 equals no Position.

    1) I need to find the Max Sum of the Size in which the Max consecutive set of 1s has occurred.

    2) I need to also do this on a day by day basis, using the Date in Column B, without having to manually go through & modify all the formulas to reference the date.

    I have a Sumif formula for the 2nd but it won't copy down to update the formula for each unique date. I have to manually change the date values & I have ~957 unique dates to do; so it would be a rather painstaking process if only done manually. Moreover, it doesn't count the Max Sum of all consecutive 1s in Column J...

    The length of the non unique columns (all columns w/o unselecting the duplicate entries) is 19,068.

    If you can be of help, I'd be very thankful...my brain is overloaded w/googling & using trial & error; lol.

    Thanks,
    Mike
    Last edited by pipsturbo; 05-12-2009 at 08:09 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Summing Values after Finding Max Consecutive Values

    1) =SUMPRODUCT(E5:E17;--(J5:J17=1))

    2) =SUMPRODUCT(E5:E17;--(J5:J17=1);--(B5:B17=C1)) where C1 is entered desired date

    Also, replace ; with , if you need

  3. #3
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Summing Values after Finding Max Consecutive Values

    Hi Zbor,

    Thanks for your response.

    2) works well but I need to find the Max Size for consecutive values of 1 values in J.

    The problem is that 1) returns the sum of all the E column when only the criteria 1 has been met.

    What I need though, is the sum Only If there has been consecutive values of 1 in the J column. Example:

    If there are 12 rows & there are 8 instances in which consecutive 1 values are shown in the J column, I need to sum the Size from E column only in that instance.

    Size Position
    Row 1 | 0 | 0
    Row 2 | 0 | 0
    Row 3 | 3.3 | 1
    Row 4 | 3.3 | 1
    Row 5 | 6.6 | 1
    Row 6 | 13.2 | 1
    Row 7 | 3.3 | 1
    Row 8 | 3.3 | 1
    Row 9 | 6.6 | 1
    Row 10 | 3.3 | 1
    Row 11 | 0 | 0
    Row 12 | 0 | 0

    So, in this case we would only sum Rows 3-10. Now if 8 were the max consecutive value of 1s in the position column, we would have a Max position size of 42.9 in Column E.

    I'm guessing that I need an array formula to properly calculate both 1) & 2).

    Do you have a solution to this?

    Thanks Zbor
    Last edited by pipsturbo; 05-12-2009 at 01:21 PM.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Summing Values after Finding Max Consecutive Values

    Instead of --(J5:J17=1) you can use any value by defining it somewhere else: --(J5:J17=C1)

    For more answers you'll need to uplaod somekind example 'cause it's hard to find soluting tapping in the dark

  5. #5
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Smile Re: Summing Values after Finding Max Consecutive Values

    Hi Zbor,

    Please see attached .xlsx.

    I have shortened this doc to 1k rows.

    In the original, it was 19,068 rows.

    Thanks,
    Mike
    Attached Files Attached Files

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Summing Values after Finding Max Consecutive Values

    Nice one.. Had to think half hour

    please, look this example and tell me is this it...
    I find max value and row where it is but I didn't go further in case I'm on wrong tail

    Example(1).xlsx

  7. #7
    Registered User
    Join Date
    04-10-2009
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Summing Values after Finding Max Consecutive Values

    Zbor,

    You are an excel master...

    Thanks a lot. I appreciate it.

    If you are ever in NY, I owe you a beer.

    Thanks & have a good evening.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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