Forum Discussion
Find 7# digits in a string
PeterBartholomew1 I combined the first two "standard GUI" steps (Source and Promote Headers) into one, just for the fact that it's possible. And I wanted to make it shorter.🙂
The SelectNumbers and Exact7 steps use custom columns and require some M coding. But nothing fancy, I dare saying. And my knowledge of M is limited, but Google is great in that aspect, as most problems have been solved already and are documented by somebody, somewhere.
Riny_van_Eekelen so here is a version 2 that will pull any 7+digit number embedded inside a text cell. There is still a question of what to do if there is more than 1 7-digit number string inside that cell as I showed in Item 5. The current LET version will return everything from start of the first instance to the end of the second instance but that could be changed but this was less complicated.
=LET(in,B3,
l,LEN(B3),
seq,SEQUENCE(,l),
foundAt,IF(ISNUMBER(--MID(in&"x",seq,7)),seq," "),
start,IF(MIN(foundAt),MIN(foundAt),l+1),
out,MID(in,start,MAX(foundAt,start)+7-start),
out)