I have a list of multiple instances of the same worker with multiple instances of work and rest. I need the name of the worker and time of the first instance of Work and the time of the last instance of Rest.
Per person I can get the first work time if I type the actual range by this formula =index(Filter(C2:D9,C2:C9="work"),1,2) This is Col G I can determine how many entries of Rest there are for the same person to then work out the time of the last rest with =index(Filter(C2:D9,C2:C9="rest"),E2,2). This is Col H And I can get a unique list of names with this formula =sort(unique(A2:A)) this is Col F
But I can't work out the formula to look at Col F against Cols A to D then return First Work Time in Col G And a formula to look at Col F (against Cols A to D) and return the Last Rest Time in Col H
My data is in columns A to D and the results I would like are shown in Cols F to H
A B c d e f g h
1 Name Date Action Time Name First Work Last Rest
2 Smith, Fred 14-03-2022 rest 00:00 4 Smith, Fred 06:03 07:08
3 Smith, Fred 14-03-2022 work 06:03 2 Jones, Harry 07:48 08:08
4 Smith, Fred 14-03-2022 rest 06:05
5 Smith, Fred 14-03-2022 work 06:06
6 Smith, Fred 14-03-2022 drive 06:15
7 Smith, Fred 14-03-2022 rest 06:59
8 Smith, Fred 14-03-2022 drive 07:02
9 Smith, Fred 14-03-2022 rest 07:08
10 Jones, Harry 14-03-2022 rest 00:00
11 Jones, Harry 14-03-2022 work 07:48
12 Jones, Harry 14-03-2022 drive 08:01
13 Jones, Harry 14-03-2022 work 08:03
14 Jones, Harry 14-03-2022 drive 08:04
15 Jones, Harry 14-03-2022 work 08:07
16 Jones, Harry 14-03-2022 rest 08:08