Formula guide · Google Sheets · Updated May 13, 2026

Google Sheets QUERY Contains

Filter rows in Google Sheets QUERY when a text column contains a word or phrase.

Quick Answer

Use contains inside the where clause when a cell only needs to include the target text.

Copyable Formula

=QUERY(A1:D100,"select A, D where B contains 'west'",1)

Syntax

=QUERY(A1:D100,"select A, D where B contains 'west'",1)

Google Sheets

Worked Example

BResult
west regionmatch
north regionignore
west prioritymatch

Result: Returns rows where the selected text column contains west.

Steps

  • Choose the text column to search.
  • Add where and the contains operator.
  • Put the search text inside single quotes.
  • Use lower or upper cleanup if casing varies heavily.

Common Mistakes

  • Using equals when the cell contains extra words.
  • Forgetting single quotes around the search text.
  • Expecting contains to behave like a full regular expression.

Excel vs Google Sheets Notes

This page is focused on Google Sheets. Excel may require a different function, pivot table, or Power Query workflow.

Editorial check: This guide was last updated May 13, 2026. Formula behavior can vary by Excel version, Google Sheets rollout, and spreadsheet locale.

FAQ