Sorry; I cannot help you directly. My rule of thumb is that if formulas are getting too complex to understand/recall clearly, it's time to use a proper programming language instead. The nice thing about org is you can have tables as inputs to and outputs of src blocks...
My papers often have awk source blocks that process tables to generate statistics for some (numerical) experiments. Spreadsheets, org tables being an example of such, are brilliant tools for simple calculations but are pretty much "write only programming languages". -- : Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-577-gf76d4d : Latest paper written in org: https://arxiv.org/abs/2106.05096