Forum Discussion
Hogstad_Raadgivning
Aug 12, 2021Iron Contributor
Find 7# digits in a string
Hi, I have text string where I would like et select numbers only from. And i manage to do that. But it find all the numbers, is it possible to only select the numbers when it is 7 digits concaten...
mtarler
Aug 12, 2021Silver Contributor
Geir, you did the 'hard' part. Now just use the formula: =IF(LEN(C3)=7,C3,"") or if you want it in a single cell you should take advantage of the new LET() function like this:
=LET(in,B3,
s,--MID(in,SEQUENCE(,MAX(LEN(in))),1),
digits,CONCAT(FILTER(s,ISNUMBER(s),"")),
IF(LEN(digits)=7,digits,""))
=LET(in,B3,
s,--MID(in,SEQUENCE(,MAX(LEN(in))),1),
digits,CONCAT(FILTER(s,ISNUMBER(s),"")),
IF(LEN(digits)=7,digits,""))