Google-sheets – How to search value in another column

formulasgoogle sheetsgoogle-sheets-arrayformularegexvlookup

Using Google Sheets, I am trying to two compare two columns on Google Sheets, like the one below:

https://i.stack.imgur.com/bK1wd.png

Basically, I want to compare column A and B, basically, if a cell in column A is inside a cell in column B (the number is inside the URL), I want to return the matching column B value in column C. Is there an easy way to do this?

Best Answer

=ARRAYFORMULA(IF(LEN(A1:A), REGEXMATCH(B1:B&"", A1:A), ))

0


=ARRAYFORMULA(IF(LEN(A1:A), IF(REGEXMATCH(B1:B&"", A1:A), B1:B), ))

0


=ARRAYFORMULA(IF(LEN(A1:A), 
 IF(REGEXMATCH(B1:B&"", TEXTJOIN("|", 1, A1:A)), B1:B), ))

0