I want to do this on a much larger problem, but chose the simplest example for a proof of concept.

*At the bottom is a CSV of my file (with formulas).*

I have **data for points** (vertices of tetrahedron):
[![enter image description here][1]][1]

I have a set of derived **data for struts** (edges of tetrahedron):
[![enter image description here][2]][2]

I am trying to generate "adaptively" and "dynamically" the array corresponding to Strut IDs for all struts that have a match under either of columns "S" or "E" (not a single column lookup) for label "D", and report the strut ID for the corresponding struts.

I would like the result to look like this:

[![enter image description here][3]][3]

I would also like to be able to set up similar lookup and tables for other nodes directly below that first result, without positional conflict.  From what I've seen, pivot tables will not offer the means of a solution.

I saw a reference to [this][4] but there isn't enough information there for me to understand that approach, nor to apply it.

Can anyone offer a solution to my problem?


**CSV (data)**

    ||||||||||||||||||||||||
    ||||||Circumradius|1|||||||||||||||||
    ||||||Edge Length|=H2*4/SQRT(6)|||||||||||||||||
    ||||||Face Height|=H3*SIN(60*PI()/180)|||||||||||||||||
    ||||||Tet Height|=SQRT(6)*H3/3|||||||||||||||||
    ||||||Centroid|=H4/3|||||||||||||||||
    ||||||||||||||||||||||||
    ||||||||||||||||||||||||
    ||||||||||||||||||||||||
    ID|Node|G_ID||||x|y|z||||||||||||||||
    A|1|A||||=H4-H6|0|0||||||||||||||||
    B|2|B||||=-H6|=H3/2|0||||||||||||||||
    C|3|C||||=-H6|=-H3/2|0||||||||||||||||
    D|4|D||||0|0|=H5||||||||||||||||
    ||||||||||||||||||||||||
    ID|Strut|G_ID|S|E||Vx|Vy|Vz||Length||Sx|Sy|Sz||Ex|Ey|Ez||||||
    AB|1|AB|A|B||=Q17-M17|=R17-N17|=S17-O17||=SQRT( (G17)^2 + (H17)^2 + (I17)^2 )||=VLOOKUP($D17,$A$11:$I$14,7,0)|=VLOOKUP($D17,$A$11:$I$14,8,0)|=VLOOKUP($D17,$A$11:$I$14,9,0)||=VLOOKUP($E17,$A$11:$I$14,7,0)|=VLOOKUP($E17,$A$11:$I$14,8,0)|=VLOOKUP($E17,$A$11:$I$14,9,0)||||||
    BC|2|BC|B|C||=Q18-M18|=R18-N18|=S18-O18||=SQRT( (G18)^2 + (H18)^2 + (I18)^2 )||=VLOOKUP($D18,$A$11:$I$14,7,0)|=VLOOKUP($D18,$A$11:$I$14,8,0)|=VLOOKUP($D18,$A$11:$I$14,9,0)||=VLOOKUP($E18,$A$11:$I$14,7,0)|=VLOOKUP($E18,$A$11:$I$14,8,0)|=VLOOKUP($E18,$A$11:$I$14,9,0)||||||
    CA|3|CA|C|A||=Q19-M19|=R19-N19|=S19-O19||=SQRT( (G19)^2 + (H19)^2 + (I19)^2 )||=VLOOKUP($D19,$A$11:$I$14,7,0)|=VLOOKUP($D19,$A$11:$I$14,8,0)|=VLOOKUP($D19,$A$11:$I$14,9,0)||=VLOOKUP($E19,$A$11:$I$14,7,0)|=VLOOKUP($E19,$A$11:$I$14,8,0)|=VLOOKUP($E19,$A$11:$I$14,9,0)||||||
    DA|4|DA|D|A||=Q20-M20|=R20-N20|=S20-O20||=SQRT( (G20)^2 + (H20)^2 + (I20)^2 )||=VLOOKUP($D20,$A$11:$I$14,7,0)|=VLOOKUP($D20,$A$11:$I$14,8,0)|=VLOOKUP($D20,$A$11:$I$14,9,0)||=VLOOKUP($E20,$A$11:$I$14,7,0)|=VLOOKUP($E20,$A$11:$I$14,8,0)|=VLOOKUP($E20,$A$11:$I$14,9,0)||||||
    DB|5|DB|D|B||=Q21-M21|=R21-N21|=S21-O21||=SQRT( (G21)^2 + (H21)^2 + (I21)^2 )||=VLOOKUP($D21,$A$11:$I$14,7,0)|=VLOOKUP($D21,$A$11:$I$14,8,0)|=VLOOKUP($D21,$A$11:$I$14,9,0)||=VLOOKUP($E21,$A$11:$I$14,7,0)|=VLOOKUP($E21,$A$11:$I$14,8,0)|=VLOOKUP($E21,$A$11:$I$14,9,0)||||||"=SMALL(IF(X25=B17:B22, ROW($D$17:$E$22)-2,""""))"
    DC|6|DC|D|C||=Q22-M22|=R22-N22|=S22-O22||=SQRT( (G22)^2 + (H22)^2 + (I22)^2 )||=VLOOKUP($D22,$A$11:$I$14,7,0)|=VLOOKUP($D22,$A$11:$I$14,8,0)|=VLOOKUP($D22,$A$11:$I$14,9,0)||=VLOOKUP($E22,$A$11:$I$14,7,0)|=VLOOKUP($E22,$A$11:$I$14,8,0)|=VLOOKUP($E22,$A$11:$I$14,9,0)||||||
    ||||||||||||||||||||||||
    ||||||||||||||||||||||Node||Struts
    ||||||||||||||||||||||4|=INDEX(A11:A14,MATCH(W25,B11:B14,0),1)|4
    ||||||||||||||||||||||||5
    ||||||||||||||||||||||||6


  [1]: https://i.sstatic.net/Q3Mh6.png
  [2]: https://i.sstatic.net/huHWS.png
  [3]: https://i.sstatic.net/s7sFL.png
  [4]: https://superuser.com/questions/1354181/libreoffice-calc-multiple-index-match-and-copy-to-other-cells