Forum Discussion
MikeWells13
Jan 20, 2023Copper Contributor
Sum formula that ignores characters in a cell that aren't numbers
Hi all, I was wondering if anyone can solve this problem for me. I'm trying to get a formula that will add the something like the following cells: 110a 21xx 7 45bbb The formula needs to ign...
- Jan 24, 2023
Here is with blanks
mtarler
Jan 20, 2023Silver Contributor
MikeWells13 I created a file with a number of useful Lambda Functions and one of them is SumNumsFromTxt
See attached
SergeiBaklan
Jan 21, 2023Diamond Contributor
As variant
sumFromTxtRange = LAMBDA(range,
LET(
getNumber, LAMBDA(str,
LET(
inNumers, CHAR(VSTACK(SEQUENCE(4, , 43), SEQUENCE(10, , 48))),
chars, LAMBDA(str, MID(str, SEQUENCE(LEN(str)), 1)),
addChar, LAMBDA(str, chr,
str & XLOOKUP(chr, inNumers, inNumers, "")
),
--REDUCE("", chars(str), addChar)
)
),
SUM(MAP(range, getNumber))
)
);