Using REGEXEXTRACT in an array, searching multiple columns

爱⌒轻易说出口 提交于 2020-01-05 04:57:16

问题


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:


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")))))


来源:https://stackoverflow.com/questions/57120505/using-regexextract-in-an-array-searching-multiple-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!