google-spreadsheet Query Function Filtering with QUERY()

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

ABCD
1penred500
2penblue-50
3penred0
4pencilblue17
5pencilgreen-1.5

To only return "pencil" data:

=QUERY("A1:D6","select * where B='pencil' ",1)

To only return rows that contain "pen" (all rows):

=QUERY("A1:D6","select * where B contains 'pen' ",1)

To only return rows where the price is greater than 0:

=QUERY("A1:D6","select * where D>0 ",1)

Note that text strings require apostrophes while numerical values do not.



Got any google-spreadsheet Question?