1

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

I have a set of derived data for struts (edges of tetrahedron): enter image description here

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

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 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:

  • formulas
  • updated with input from accepted answer updated the CSV with
  • setup for next phase of "proof-of-concept" for methodology applied to structural analysis of geodesic dome
|||||||||||||||||||||||||||
||||||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||-Vx|-Vy|-Vz||Length||Sx|Sy|Sz||Ex|Ey|Ez|||||
AB|1|AB|A|B||=(U17-Q17)/$O17|=(V17-R17)/$O17|=(W17-S17)/$O17||=-G17|=-H17|=-I17||=SQRT( (U17-Q17)^2 + (V17-R17)^2 + (W17-S17)^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||=(U18-Q18)/$O18|=(V18-R18)/$O18|=(W18-S18)/$O18||=-G18|=-H18|=-I18||=SQRT( (U18-Q18)^2 + (V18-R18)^2 + (W18-S18)^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||=(U19-Q19)/$O19|=(V19-R19)/$O19|=(W19-S19)/$O19||=-G19|=-H19|=-I19||=SQRT( (U19-Q19)^2 + (V19-R19)^2 + (W19-S19)^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||=(U20-Q20)/$O20|=(V20-R20)/$O20|=(W20-S20)/$O20||=-G20|=-H20|=-I20||=SQRT( (U20-Q20)^2 + (V20-R20)^2 + (W20-S20)^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||=(U21-Q21)/$O21|=(V21-R21)/$O21|=(W21-S21)/$O21||=-G21|=-H21|=-I21||=SQRT( (U21-Q21)^2 + (V21-R21)^2 + (W21-S21)^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)|||||
DC|6|DC|D|C||=(U22-Q22)/$O22|=(V22-R22)/$O22|=(W22-S22)/$O22||=-G22|=-H22|=-I22||=SQRT( (U22-Q22)^2 + (V22-R22)^2 + (W22-S22)^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)|||||
|||||||||||||||||||||||||||
||||||||||||||||||||||||Struts joined at identified nodes (contributors to force/moment equations)|||
|||||||||||||||||||||||||||
|||||||||||||||||||||||||Node|ID|Strut
|||||||||||||||||||||||||4|=INDEX($A$11:$A$14,MATCH(Z27,$B$11:$B$14,0),1)|"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA27=$D$17:$D$22)+(AA27=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||
|||||||||||||||||||||||||Node|ID|Strut
|||||||||||||||||||||||||1|=INDEX($A$11:$A$14,MATCH(Z35,$B$11:$B$14,0),1)|"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA35=$D$17:$D$22)+(AA35=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||
|||||||||||||||||||||||||Node|ID|Strut
|||||||||||||||||||||||||2|=INDEX($A$11:$A$14,MATCH(Z43,$B$11:$B$14,0),1)|"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA43=$D$17:$D$22)+(AA43=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||
|||||||||||||||||||||||||Node|ID|Strut
|||||||||||||||||||||||||3|=INDEX($A$11:$A$14,MATCH(Z51,$B$11:$B$14,0),1)|"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
|||||||||||||||||||||||||||"{=IFERROR(INDIRECT(""B""&SMALL(IF((AA51=$D$17:$D$22)+(AA51=$E$17:$E$22),ROW($D$17:$D$22),""""),ROW($D$17:$D$22)-16)),"""")}"
3
  • Might this be better done in LibreOffice Base, which offers use of complex SQL queries? Commented Oct 30, 2023 at 13:51
  • Thank you, DrMoishe Pippik. The info provided so far is limited. The full intent is to perform a proper analysis of force/load/displacement along each strut and at each node for a half-sphere geodesic of an even-numbered "frequency" pattern. I plan to "translate" the process into a full-fledge C program, once I properly formulated the relationships that need to be balanced and computed. So, I prefer not to look at LibreOffice Base. Commented Oct 30, 2023 at 21:48
  • If there is no way to do this automatically, I will be forced to do it manually and iteratively, which I was hoping to avoid. Commented Oct 31, 2023 at 1:13

1 Answer 1

1

The link in your question is good, but it needs to be adjusted as follows.

=IFERROR(INDIRECT("B"&SMALL(IF(X25=$D$17:$D$22;ROW($D$17:$D$22);"");ROW($D$17:$D$22)-16));"")

Enter as an array formula {} by pressing Ctrl+Shift+Enter. The result is 4, 5, and 6 as you requested.

Adjustments:

  • INDIRECT("B"& — In your case, you want the value from column B, not the index.
  • X25= instead of "a"= because you want the value from that row.
  • ROW($D$17:$D$22)-16 instead of ROW()-2 because the row number is from the D column, not from the location where you're putting the formula.

EDIT:

The OR function itself will not work in an array formula, so use the + operator instead.

=IFERROR(INDIRECT("B"&SMALL(IF((X25=$D$17:$D$22)+(X25=$E$17:$E$22);ROW($D$17:$D$22);"");ROW($D$17:$D$22)-16));"")

Result: 2, 3, 6

Regarding your other comment, it's not directly based on the size of the source — the resulting array is actually that big, only some of the results are empty strings ("" in the formula). You could add a filter to hide empty results by selecting column Y, going to Data > Auto Filter and unchecking (empty).

7
  • Thank you, @Jim K. I confirmed that works for the case of Node 4, getting 3 items ordered ascending, but if I replace the value of 4 with 3, I only get 1 result (3), when I am looking for 3 results again (should always be 3 for this geometric configuration), namely a match on "C" from columns D17:E22, which should give me 2,3 and 6. Is there a way to specify that? Commented Oct 31, 2023 at 20:53
  • Is it possible to have the arrays limit themselves to the size of the results, not the size of the "source" lookup "array"? Commented Oct 31, 2023 at 21:43
  • Is there a way to use OR to combine the results of two separate formulas in the same formula, each focusing on one of the columns "D" or "E" ? If I use a separate formula for 2 separate "arrays" (columns), is there a way to OR those two "arrays" into a single new array which has no empty cells? Commented Oct 31, 2023 at 21:45
  • @EricMarceau: See edited answer to handle that example.
    – Jim K
    Commented Oct 31, 2023 at 21:50
  • Thank you again, @Jim K. Is there any way to "output" nothing, i.e. not "add" empty string as a case response in an array position, thereby leaving only "real" responses in the array, which would then be limited to the size of actual data? Commented Nov 1, 2023 at 2:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .