Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google sheets Filter formula for text containing

I am unable to make the below filter formula work. Notice that I am trying to refer to the sheet "Data" and filter them into another sheet. I get error saying there were no matches.

=FILTER(Data!A3:Data!J, ARRAYFORMULA(REGEXMATCH(Data!J3:Data!J, ".*km.*")))

However, the above formula works when I insert it in the "Data" sheet. Notice that "Data!" is removed as it is in same sheet.

=FILTER(A3:J, ARRAYFORMULA(REGEXMATCH(J3:J, ".*km.*")))

I tried using the below sets with same results.

=FILTER(A3:J, REGEXMATCH(J3:J, ".*km.*"))
=FILTER(Data!A3:Data!J, REGEXMATCH(Data!J3:Data!J, ".*km.*"))

I have no problems filtering dates, numbers from "Data" sheet into my filtering sheet. It is only with "text contains" condition. Any help to resolve this is appreciated.

like image 506
Sandeep S D Avatar asked Jan 26 '23 15:01

Sandeep S D


1 Answers

The formula was wrong. I was using the "Data!" twice. The below code works. Phew! Switching between languages (autohotkey, html, javascript, LibreOffice basic) seems to be taking a toll.

=FILTER(Data!A3:J, REGEXMATCH(Data!J3:J, ".*km.*"))
like image 148
Sandeep S D Avatar answered Feb 03 '23 07:02

Sandeep S D