FormulaCraft

How to use QUERY with LIKE wildcards in Excel and Google Sheets

Topic:QUERY (Google Sheets SQL)

Heads up: Excel and Google Sheets do this differently.

Excel
=FILTER(A2:C10,ISNUMBER(SEARCH("Pro",B2:B10)))
Google Sheets
=QUERY(A1:C10,"SELECT A, B, C WHERE B LIKE '%Pro%'",1)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Identify the column you want to do a partial-match filter on — for example, B holds product names.
  2. 2To match rows where B contains the text 'Pro' anywhere: =QUERY(A1:C10,"SELECT A, B, C WHERE B LIKE '%Pro%'",1).
  3. 3To match rows where B starts with 'Pro': use WHERE B LIKE 'Pro%' (no leading percent).
  4. 4To match rows where B ends with 'Plus': use WHERE B LIKE '%Plus'.
  5. 5To inject a dynamic search term from cell E2, concatenate: "SELECT A, B, C WHERE B LIKE '%"&E2&"%'".

Tips

Need the Google Sheets version instead? Open Sheets variant in workspace →

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Does QUERY LIKE support regular expressions?

No. QUERY LIKE only supports the SQL-style % (any string) and _ (single character) wildcards. For regex matching, use REGEXMATCH inside a Google Sheets helper column and query that boolean column.

How do I do a case-insensitive LIKE search?

Add a helper column with =LOWER(B2) dragged down, then query LIKE '%pro%' on that column. Alternatively, use FILTER with SEARCH which is case-insensitive: =FILTER(A2:C10, ISNUMBER(SEARCH(E2, B2:B10))).

Can I use LIKE with a cell reference for the pattern?

Yes — concatenate: "WHERE B LIKE '%"&E2&"%'". If E2 contains 'Pro', the effective query string becomes WHERE B LIKE '%Pro%'.

More on QUERY (Google Sheets SQL)

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: