Best lap time of N consequential laps

Johhny

New Member
Joined
Oct 21, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi!

I stucked and I am not sure whether this could be resolved in excel. Can you help?

I have a dataset (attached example) of lap times:
  • each record represents one lap time
  • there might be many drivers
  • there might be many sessions (occasions on which laps were taken)
  • each lap might be valid or invalid

My aim is to calculate best average lap time of N cosequential laps for each driver our of all sessions. By consequential lap I mean a series of consequential valid laps.

Book1.xlsx
ABCDEFGHIJKL
1SessionDriverLapNumValidLapTimeDriver
21A1TRUE10Best of:ABC
31A2TRUE1116
41A3FALSE928
51A4TRUE838
61A5TRUE104
71A6TRUE65
81A7FALSE7
9
Sheet1
Cell Formulas
RangeFormula
I5I5=SUM(E5:E7)/3
 
ABCDEFGHI
1SessionDriverLapNumValidLapTimeSession12
21A1TRUE10DriverAA
31A2TRUE11Best of
41A3FALSE9163
51B1TRUE7285.5
61A4TRUE8386.7
71A5TRUE104n/a7.25
81A6TRUE65n/an/a
91A7FALSEn/a
102A1TRUE5
112A2TRUE6
122A3TRUE9
132A4TRUE9
142A5FALSE9
152A6TRUE3
162C1TRUE9
Sheet4
Cell Formulas
RangeFormula
H4:I8H4=LET(B,99999,t,FILTER($D$2:$E$16,($A$2:$A$16=H$1)*($B$2:$B$16=H$2)),s,SEQUENCE(ROWS(t))+SEQUENCE(,$G4,0),x,MIN(MMULT(IFERROR(INDEX(t,s,2)/INDEX(t,s,1),B),SEQUENCE($G4,,1,0))),IF(x<B,x/$G4,"n/a"))
 
Upvote 0
Solution

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You're welcome.

I didn't test it rigorously, so I suggest you check it works under the various scenarios you might realistically encounter.
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,072
Latest member
DW Draft

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