I wrote an Excel LAMBDA
function for extracting numbers from a string.
This is the formula
get.numbers=LAMBDA(text,ntext,position,size,VALUE(LET(x,LEN(text),n,position,IF(n>x,ntext,get.numbers(text,IF(ISNUMBER(VALUE(MID(text,n,size))),ntext&MID(text,n,size),ntext),n+1,size)))))
The formula works well when the text is from a single cell range eg A2
, but if you try to use it on a spill range (A2#
) it returns #NUM! error.
I have another LAMBDA
function that accepts a string and gets a character from a particular position in another string. It joins to character to the given string if the character is a number. I tried to use this function within the get.numbers function but it returned error.
My conclusions are
- Lambda function cannot be used within a recursive lambda function
- Recursive Lambda function cannot accept data from a spill range
Is there any way out of this?