Forum Discussion
Stacked Excel Formula
- Feb 10, 2026
Hi tsbarton70,
I created below formula a few days ago but I was very hesitant whether I should post it or not, as it is a very large and difficult formula to understand, but in the end I decided to post it today. If this formula does not serve to you, or in real conditions it does not give the right results, then let me know and I will delete this post.
=IFNA(TOCOL(EXPAND(BYROW(--TRANSPOSE(TEXTSPLIT(TEXTJOIN(";",, BYCOL(B2:G13, LAMBDA(x, ARRAYTOTEXT(LET(d, SUBSTITUTE(x, " ", ""), rw, ROWS(d), mod, MOD(SEQUENCE(rw), 2), br, BYROW(IF(d = "", 0, d), LAMBDA(a, TRIM(REGEXREPLACE(REGEXREPLACE(SUBSTITUTE(SUBSTITUTE(a, ">", ">"), "<", "<"), "[^0-9.,+\-*/^()≤≥<>=% ]", " "), "\s+", " ")))), tb, IFERROR(TEXTBEFORE(br, " ", LEN(br) - LEN((SUBSTITUTE(br, " ", "")))), br), op, FILTER(tb, mod = 0), LET(a, --SUBSTITUTE(--FILTER(tb, mod = 1), ",", "."), b, --SUBSTITUTE(IFERROR(--BYROW(op, LAMBDA(y, IFERROR(REGEXEXTRACT(TRIM(SUBSTITUTE(SUBSTITUTE(y, ">", ">"), "<", "<")), "[0-9]+(?:[.,][0-9]+)?"), ""))), 0), ",", "."), op, XLOOKUP(BYROW(op, LAMBDA(z, IFERROR(REGEXEXTRACT(TRIM(SUBSTITUTE(SUBSTITUTE(z, ">", ">"), "<", "<")), "(>=|<=|≥|≤|>|<|=)"), ""))), {"<","≤","=","≥",">"}, {"<","<=","=",">=",">"}), IFNA(IF(SWITCH(op, ">=", a >= b, "<=", a <= b, ">", a > b, "<", a < b, "=", a = b, NA()), 0, 1), 0))))))), ", ", ";")), SUM),, 2)), "")Hope this helps.
IlirU
Hi tsbarton70
We haven't heard from you since day 1. Is this issue sorted out? Did any of the proposal you got did it?
At the bottom of each reply you got there's a Mark as solution link ==> Helps people who Search for existing solutions
Thanks
- tsbarton70Mar 05, 2026Copper Contributor
I am so sorry. It got hectic on my end (medical issues/state inspections) so I haven't tried the solutions yet. Since things have now calmed down, I will be working on it today. I will update everything once it's completed.