Feb 28 2024 01:56 AM
=SUMPRODUCT(IF(ISNUMBER(FILTERXML("<t><s>" & TEXTJOIN("</s><s>", TRUE, H9:H100) & "</s></t>", "//s")), FILTERXML("<t><s>" & TEXTJOIN("</s><s>", TRUE, H9:H100) & "</s></t>", "//s"), 0))
thank you everyone for help.
Feb 28 2024 02:30 AM
Nothing is wrong with formula, but it depends on which kind of values you have in H9:H100. Plus it's not necessary to use FILTERXML on 365, TEXTSPLIT could work.
Feb 28 2024 05:39 AM - edited Feb 28 2024 07:34 AM
@SergeiBaklanhi thanx for your answer. i want to calculate total amount of yellow colored numbers on the right side of the photo.
Feb 28 2024 06:57 AM
Do you mean extract numbers from texts and sum them, e.g. 700N, 400N => 700+400=>1100
or just count number of values which are not equal to "*" ? If so the answer for above will be 2
Feb 28 2024 07:06 AM
Feb 28 2024 07:57 AM
As variant that could be
=REDUCE(
0,
FILTER(range, range <> "*"),
LAMBDA(a,v,
a + IFERROR(
--LEFT( v,
XMATCH(
FALSE,
ISNUMBER(--MID(v, SEQUENCE(LEN(v)), 1) )
) - 1
), v )
)
)
Feb 28 2024 08:42 AM
Mar 01 2024 05:01 AM
...never used before the "--" in the meaning of "*1" thank you for tip. my version is slightly different and also a bit uglier
=SUM(
MAP(range;
LAMBDA(iter;
IFERROR(
LEFT(iter;
MAX(
IFERROR(
XMATCH(
SEQUENCE(10;;0)&"";
MID(iter;
SEQUENCE(
LEN(iter);;1);1);0;-1);0)))*1;0))))
Mar 01 2024 07:45 AM
Thanks for sharing. Didn't test, but I guess your variant takes all text numbers into account, i.e. if the have 1000 QNB2 the latest 2 won't be ignored.
As for the double negations, aka double dashes, that's more or less standard option The double negative in Excel formulas | Exceljet . I personally prefer to use it instead of 1* or +0 or VALUE(), but that's each person choice. Everything in Excel could be done by several ways.