Forum Discussion
tsbarton70
Feb 06, 2026Copper Contributor
Stacked Excel Formula
Hello everyone. I've spent the past 2-3 hours trying to figure this out on my own without luck. What I'm needing is a formula that will check D11 (highlighted) to make sure that it's within the param...
IlirU
Feb 10, 2026Iron Contributor
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
Lorenzo
Feb 20, 2026Silver Contributor
Hey IlirU
(It's been a while...). I haven't tried to "debug" your formula but think I saw somewhere:
IFERROR(
TEXTBEFORE(br, " ", LEN(br) - LEN( SUBSTITUTE(br, " ", "") ) ),
br
)TEXTBEFORE last arg. - [if_not_found] - could be used instead:
TEXTBEFORE(br, " ", LEN(br) - LEN( SUBSTITUTE(br, " ", "") ),,, br)Cheers
Lz.