Spreadsheet: 689967d1596784617-multiple-lookups-ordered-by-timestamp-lookup-example-updated
Sheet: Sheet1

Table 1 |  |  |  |  | Alfanumeric |  |  | Table 2 |  |  | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 1 | 1 | 1 | <- Order
Phase1, 2, 3 | Code | Criterion | Created On | Created At | Result |  |  | Phase1 | Phase2 | Phase3 | A | A | B | B | C | C | D | D | E | E | F | F | G | H | I | J | <- Code
123456 | A | false | 2018-11-12 00:00:00 | 09:38:20 | 0.001 |  |  | 123456 | 123458 | 123460 | 0.001 | 0,2% | 0.003 | 0.004 | 0.009 | 0.011 | 0.01 | 0.012 | 0.017 | 2,0% | 0.018 | 0.019
123456 | A | false | 2018-11-12 00:00:00 | 09:38:21 | 0,2% |  |  | 123456 | 123458 | 123460 | 0.001 | 0,2% | 0.003 | 0.004 | 0.009 | 0.011 | 0.01 | 0.012 | 0.017 | 2,0% | 0.018 | 0.019
123456 | B | false | 2018-11-12 00:00:00 | 09:38:59 | 0.003 |  |  | 123456 | 123458 | 123460 | 0.001 | 0,2% | 0.003 | 0.004 | 0.009 | 0.011 | 0.01 | 0.012 | 0.017 | 2,0% | 0.018 | 0.019
123466 | P | false | 2018-11-12 00:00:00 | 09:41:25 | 0.004 | x |  | 123456 | 123458 | 123460 | 0.001 | 0,2% | 0.003 | 0.004 | 0.009 | 0.011 | 0.01 | 0.012 | 0.017 | 2,0% | 0.018 | 0.019
123456 | B | false | 2018-11-12 00:00:00 | 09:38:59 | 0.004 |  |  | 123457 | 123459 | 123461 | 0,5% | 0.006 | 0.007 |  | 0.013 | 1,5% |  | 0.016 |  |  |  |  | 0.021 | 0.022 | 0.023 | 0.024
123457 | A | false | 2018-11-12 00:00:00 | 09:41:25 | 0,5% |  |  | 123457 | 123459 | 123461 | 0,5% | 0.006 | 0.007 |  | 0.013 | 1,5% |  | 0.016 |  |  |  |  | 0.021 | 0.022 | 0.023 | 0.024
123457 | B | false | 2018-11-12 00:00:00 | 09:41:25 | 0.007 |  |  | 123457 | 123459 | 123461 | 0,5% | 0.006 | 0.007 |  | 0.013 | 1,5% |  | 0.016 |  |  |  |  | 0.021 | 0.022 | 0.023 | 0.024
123457 | B | true | 2018-11-12 00:00:00 | 09:41:25 | 0.008 | x |  | 123457 | 123459 | 123461 | 0,5% | 0.006 | 0.007 |  | 0.013 | 1,5% |  | 0.016 |  |  |  |  | 0.021 | 0.022 | 0.023 | 0.024
123458 | C | false | 2018-11-12 00:00:00 | 09:41:25 | 0.009
123461 | J | false | 2018-11-12 00:00:00 | 09:15:13 | 0.024
123458 | D | false | 2018-11-12 00:00:00 | 10:44:54 | 0.01 |  |  | Transfer results from Table 1 to Table 2 by:
123458 | C | false | 2018-11-12 00:00:00 | 10:48:44 | 0.011
123463 | G | false | 2018-11-12 00:00:00 | 10:44:54 | 0.008 | x |  | For each row in Table2, match either of Phase1, Phase2 and Phase3 with the column Phase1, 2, 3 in Table1.
123458 | D | false | 2018-11-12 00:00:00 | 10:48:44 | 0.012 |  |  | For each column in Table2, match the Codes with the Codes in Table1.
123459 | D | true | 2018-11-12 00:00:00 | 10:47:01 | 0.014 | x |  | For each coulmn in Table2, match the [NAME] number for the given Code with the timestamp in columns Created On and Created At in Table1.
123464 | C | true | 2018-11-12 00:00:00 | 10:51:36 | 0.01 | x |  | The oldest timestamp shall give the lowest order number for the given code.
123459 | C | false | 2018-11-12 00:00:00 | 10:50:29 | 1,5% |  |  | If there are duplicate timestamps for a given match, both shall be counted with and the first occurrence shall return the first occurring result value and the next one(s) shall return the succeeding result value(s).
123459 | D | false | 2018-11-12 00:00:00 | 10:52:22 | 0.016
123467 | K | false | 2018-11-12 00:00:00 | 10:48:44 | 0.009 | x
123460 | E | false | 2018-11-12 00:00:00 | 10:50:52 | 0.017
123462 | A | false | 2018-11-12 00:00:00 | 09:41:25 | 0.007 | x
123460 | F | false | 2018-11-12 00:00:00 | 10:51:36 | 0.018
123460 | F | false | 2018-11-12 00:00:00 | 10:51:36 | 0.019
123475 | M | false | 2018-11-12 00:00:00 | 10:51:47 | 0.003 | x
123460 | E | false | 2018-11-12 00:00:00 | 10:51:36 | 2,0%
123461 | G | false | 2018-11-12 00:00:00 | 10:51:47 | 0.021
123457 | A | false | 2018-11-12 00:00:00 | 09:41:25 | 0.006
123461 | H | false | 2018-11-13 00:00:00 | 07:26:18 | 0.022
123459 | C | false | 2018-11-12 00:00:00 | 10:48:44 | 0.013
123461 | I | false | 2018-11-12 00:00:00 | 09:15:13 | 0.023
123475 | E | false | 2018-11-12 00:00:00 | 10:51:36 | 0.002 | x
Comment regarding (x):
These Phase 1, 2, 3 number are not included in Table 2, either because they are not relevant or because the Criterion column says "true". Therefore none of the Code values that are only used by these numbers shall be included in the headline of Table 2 (i.e. K, M and P).
However, the Code values A, C and E are still to be included since they are also used by Phase numbers reflected in Table 2.