Using REGEXEXTRACT in an array, searching multiple

2019-08-13 07:26发布

Can someone please tell me what I am doing wrong in this formula?

=ARRAYFORMULA(REGEXEXTRACT((A2:A&"")+(B2:B&"")+(C2:C&"")), "02(\d{14})37")

I'm trying to extract a 14 digit number that sits between 02 and 37 that may be in columnA, columnB or columnC.

I've tried this also, with the expected result showing on the first row only:

=ARRAYFORMULA(REGEXEXTRACT(textjoin(" ",true,A2:C),"02(\d{6,14})37"))

I'm really confuzzled.

1条回答
男人必须洒脱
2楼-- · 2019-08-13 08:11

it needs to be like this:

=ARRAYFORMULA(IFERROR(IFERROR(IFERROR(IFERROR(
 REGEXEXTRACT(A2:A&"", "02(\d{14})37"), 
 REGEXEXTRACT(B2:B&"", "02(\d{14})37")),   
 REGEXEXTRACT(C2:C&"", "02(\d{14})37")))))
查看更多
登录 后发表回答