Matrix Equation Help Report if next five values that correspond to other column are within required timeframe

Luke_Tk

New Member
Joined
May 4, 2018
Messages
3
I have some times that I am trying to analyze through the use of a helper column. In Column B I have a list of operation numbers, in Column G I have a list of time differences. In the helper column I want to check if the next 5 time differences for the same operation are under 7 minutes. In the event that the 5 times are all under 7 minutes, I want to post a 1. The latest iteration of the formula that I've tried is below:
<time(0,7,0),if(index(g3:g1000,match(b2,b3:b1000,0))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),2))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),3))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),4))<time(0,7,0),1,""),""),""),""),"")


<time(0,7,0),
<time(0,7,0),
<time(0,7,0),
<time(0,7,0),
<time(0,7,0),
=IF(G2<TIME(0,7,0),
IF(INDEX(G3:G1000,MATCH(B2,B3:B1000,0))<TIME(0,7,0),
IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),2))<TIME(0,7,0),
IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),3))<TIME(0,7,0),
IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),4))<TIME(0,7,0),
1,""),""),""),""),"")

I know the issue lies inside of the If(Index(Small( as those won't run even if I break off the rest of the code, but I can't figure out what the error is.

I'm somewhat new to matrix equations like this so I feel like I am probably making this harder than it needs to be, but I appreciate any help. Thanks</time(0,7,0),
</time(0,7,0),
</time(0,7,0),
</time(0,7,0),
</time(0,7,0),
</time(0,7,0),if(index(g3:g1000,match(b2,b3:b1000,0))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),2))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),3))<time(0,7,0),if(index(g3:g1000,small(if(b3:b1000=b2,row(b3:b1000)-row(index(b3:b1000,1,1))+1),4))<time(0,7,0),1,""),""),""),""),"")
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
I tried to format the code nicely so it was easier to read, and the forum got rid of parts and pushed it all together so here it is in all its glory meshed together.

=IF(G2<TIME(0,7,0),IF(INDEX(G3:G1000,MATCH(B2,B3:B1000,0))<TIME(0,7,0),IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),2))<TIME(0,7,0),,IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),3))<TIME(0,7,0),,IF(INDEX(G3:G1000,SMALL(IF(B3:B1000=B2,ROW(B3:B1000)-ROW(INDEX(B3:B1000,1,1))+1),4))<TIME(0,7,0),1,""),""),""),""),"")
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

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