Originally Posted by
nick.williams
You should just need to replace "A1" with whatever cell you are referencing. But also I guess you want the results to display horizontal rather than vertical so I tweaked the SEQUENCE formula too. And I added in something so it returns "-" if there are no results. Try this in C2, then copy down:
=LET(values,MID(B2,SEQUENCE(1,LEN(B2)-6),7),FILTER(values,(LEFT(values,3)="BR.")*ISNUMBER(RIGHT(values,4)+0),"-"))
I notice this also returns BR.533 in your example. I don't know if that's a typo or if you might have 3-digit codes in your real data. If you need to exclude things like that then the safest way might be to test each of the 4 digits separately, although it gets a bit clunky:
=LET(values,MID(B2,SEQUENCE(1,LEN(B2)-6),7),FILTER(values,(LEFT(values,3)="BR.")*ISNUMBER(MID(values,4,1)+0)*ISNUMBER(MID(values,5,1)+0)*ISNUMBER(MID(values,6,1)+0)*ISNUMBER(MID(values,7,1)+0),"-"))
Bookmarks