šŸ“‘ LIKE String Operator in Google Sheets Query and Wildcard Use

Bookmarked LIKE String Operator in Google Sheets Query and Wildcard Use (InfoInspired)

The LIKE string operator in Google Sheets Query is useful for complex comparisons. It helps you use two wildcards in Google Sheets Query.

I know that it is possible to use wildcards in VLOOKUPS, however I was wondering for a means of incorporating a wildcard into a QUERY. Ideally, I wanted to replace a letter with a wildcard, but I did find a couple of posts discussing the use of LIKE to incorporate % or _ options. For example:

=query(A2:A,"Select A where A like 'A%'")

As well as MATCH to utilise REGEX:

=query(A1:B, "Select * where B matches 'India|Russia' ")

Rather than an OR statement:

=query(A1:B, "Select * where B = 'India' or B = 'Russia'")

Using REGEX also allows you to match a substring anywhere in a string:

=query(A1:B, "Select * where B matches '.*India.*' ")

Although I was still stuck with my initial problem (might need to explore the use of an IF statement), however I did pick up a few more possibilities.

Leave a Reply

Your email address will not be published. Required fields are marked *