Spreadsheet: 695028d1599980454-filling-in-gaps-in-rows-by-deducing-relationships-across-table-filling-in-the-gaps
Sheet: Gaps

Possible occurrence types: |  |  |  |  |  |  |  | General:
Level1 | Level2 | Level3 | Type | Level1 | Level2 | Level3 |  | A single A can point to many [NAME] which again can point to many [NAME].
A | B | C | 1 | 1 | 2 | 3 |  | A single C can point to only one B which again can point to only one A.
A | B |  | 2 | 1 | 2 |  |  | Use this to create as many connections between entries as possible, then remove duplicates, remove less complete combinations and sort the results {1\2\3} and put blanks at bottom.
A |  | C | 3 | 1 |  | 3 |  | [NAME] should work with both text entries and number entries.
A |  |  | 4 | 1
 | B | C | 5 |  | 2 | 3
 | B |  | 6 |  | 2
 |  | C | 7 |  |  | 3
 |  |  |  | Table 1 |  |  |  |  |  | Table 2 |  |  |  | Table 3 |  |  |  | Table 4
Possible connection types to be made (new connections marked in green): |  |  |  |  |  |  |  |  |  | Create possible connections (see formula in cols K, L, M). Need improved, less memory intensive dynamic array in cell K13. |  |  |  | Remove duplicates (see formula in col O) |  |  |  | Remove less complete combinations and sort {1\2\3}, putting blanks at bottom (see formula in col S)
A | B | C |  | 1 | 2 | 3 |  | I => |  |  | 2 | 3 | => |  | 2 | 3 | => |  | 2 | 3 |  |  | 2 | 3
 |  |  |  |  |  |  |  |  |  |  |  |  |  | 4 |  | 6 |  | 4 | 5
D |  | F |  | 4 |  | 6 |  | II => |  | 4 |  | 6 |  | 4 | 5 |  |  | 4 |  | 6 |  | 4 |  | 6
D | E |  |  | 4 | 5 |  |  |  |  | 4 | 5 |  |  | 7 | 8 | 9 |  | 7 | 8 | 9 |  | 4 | 5
 |  |  |  |  |  |  |  |  |  |  |  |  |  |  | 8 | 9 |  | 10 | 11 | 12
G |  | I |  | 7 |  | 9 |  | III => |  | 7 | 8 | 9 |  | 10 | 11 |  |  | 13 | 14 |  |  | 7 | 8 | 9
 | H | I |  |  | 8 | 9 |  |  |  |  | 8 | 9 |  | 10 | 11 | 12 |  | 19 | 20 |  |  |  | 8 | 9
 |  |  |  |  |  |  |  |  |  |  |  |  |  | 13 | 14 |  |  | 25 |  | 27
J | K |  |  | 10 | 11 |  |  | IV => |  | 10 | 11 |  |  |  | 17 | 18 |  | 28 | 29 |  |  | 10 | 11
 | K | L |  |  | 11 | 12 |  |  |  | 10 | 11 | 12 |  | 19 | 20 |  |  | 34 |  |  |  | 10 | 11 | 12
 |  |  |  |  |  |  |  |  |  |  |  |  |  | 19 |  |  |  |  | 17 | 18
M | N |  |  | 13 | 14 |  |  | V => |  | 13 | 14 |  |  |  | 23 | 24 |  |  | 23 | 24 |  | 13 | 14
 | N |  |  |  | 14 |  |  |  |  | 13 | 14 |  |  |  | 23 |  |  |  | 32 | 33 |  | 13 | 14
 |  |  |  |  |  |  |  |  |  |  |  |  |  | 25 |  | 27 |  |  | 38
 | Q | R |  |  | 17 | 18 |  | VI => |  |  | 17 | 18 |  | 28 | 29 |  |  |  |  | 42 |  |  | 17 | 18
 |  | R |  |  |  | 18 |  |  |  |  | 17 | 18 |  |  | 32 | 33 |  |  |  |  |  |  | 17 | 18
 |  |  |  |  |  |  |  |  |  |  |  |  |  | 34
S | T |  |  | 19 | 20 |  |  | VII => |  | 19 | 20 |  |  |  | 38 |  |  |  |  |  |  | 19 | 20
S |  |  |  | 19 |  |  |  |  |  | 19 |  |  |  |  |  | 42 |  |  |  |  |  | 19
 | W | X |  |  | 23 | 24 |  | VIII => |  |  | 23 | 24 |  |  |  |  |  |  |  |  |  |  | 23 | 24
 | W |  |  |  | 23 |  |  |  |  |  | 23 |  |  |  |  |  |  |  |  |  |  |  | 23
Y |  | AA |  | 25 |  | 27 |  | IX => |  | 25 |  | 27 |  |  |  |  |  |  |  |  |  | 25 |  | 27
AB | AC |  |  | 28 | 29 |  |  | X => |  | 28 | 29 |  |  |  |  |  |  |  |  |  |  | 28 | 29
 | AF | AG |  |  | 32 | 33 |  | XI => |  |  | 32 | 33 |  |  |  |  |  |  |  |  |  |  | 32 | 33
AH |  |  |  | 34 |  |  |  | XII => |  | 34 |  |  |  |  |  |  |  |  |  |  |  | 34
 | AL |  |  |  | 38 |  |  | XIII => |  |  | 38 |  |  |  |  |  |  |  |  |  |  |  | 38
 |  | AP |  |  |  | 42 |  | XIV => |  |  |  | 42 |  |  |  |  |  |  |  |  |  |  |  | 42