Sum Longest streak with IF condition

carlitosz

New Member
Joined
May 7, 2023
Messages
1
Hello,

Based on this previous thread: Sum longest streak

I have this data set, very similar problem, but with a change in orientation:

Total Shifts In RowConsecutive Hours11/1411/1511/1611/1711/1811/1911/20
55.438.478.306.837.635.38

This data goes from D2 (Total Shifts in a Row) to L3 (5.38)

I'm using this in Column D3 to help calculate the max consecutive shifts, which is working perfect.
=IF(arrayformula( max( len( split( join( "", left(F3:AC3 > 0) ), "F" ) ) ) )=24,0,arrayformula( max( len( split( join( "", left(F3:AC3 > 0) ), "F" ) ) ) ))

What I'm looking to get is IF the employee has worked 5 or more shifts (Column D3), then calculate the SUM of the consecutive 5 or 6 days hours worked.

In this case this employee worked 5 consecutive days between 11/14 and 11/18 and the formula on column E3 should provide a total of hours worked of 36.67.

I can't figure this out! I'm using Google Sheets.

1732209617724.png
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
I'm using 365 Installed on a PC. Not sure if this will work on google sheet, but I guess the idea should help (hopefully)
Book4
DEFGHIJKL
2StreakHours14-Nov15-Nov16-Nov17-Nov18-Nov19-Nov20-Nov
3536.665.438.478.36.837.635.38
Sheet1
Cell Formulas
RangeFormula
G2:L2G2=F2+1
D3D3=COUNT(F3:INDEX(F3:L3,MATCH(TRUE,(F3:L3=""),0)))
E3E3=SUM(F3:INDEX(F3:L3,MATCH(TRUE,(F3:L3=""),0)))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,180
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top