Google Sheets Query Function Explained

Опубликовано: 22 November 2026
на канале: Leila Gharani
404,908
7.4k

Learn the Google Sheets QUERY function step by step: select, where, group by, pivot, order by and more.
📥 Get the practice workbook (copy it to your Google Drive): https://www.xelplus.com/google-sheets...

🎓 Google Sheets: The Comprehensive Masterclass (500,000+ enrolled in our courses): https://www.xelplus.com/course/google...

QUERY can feel hard because it can do so much. Once you know the rules, it gets easy. I start with the clauses and the order they must follow, then build reports step by step.

You'll see how to sum with group by, remove blank rows with where is not null, pivot by a second column, sort with order by, and clean up results with format, label and limit.

✅ Good to know:
Use column letters (A, B, C) when the data is in the same file. When the data comes from another formula, like IMPORTRANGE, use Col1, Col2 and so on.
Text values in the query go in single quotes, like where A = 'Actual'.

⏱️ Chapters:
00:00 Google Sheets QUERY function explained
00:43 QUERY clauses and their order
01:57 Write your first QUERY (select all)
03:29 Select specific columns (letters vs Col1)
04:41 Sum data with group by
06:59 Remove blank rows with where is not null
07:51 Pivot data with QUERY
08:27 Filter text with where (single quotes)
09:49 Sort with order by desc
10:19 Format numbers with the format clause
11:06 Rename columns with the label clause
11:32 Show top results with limit

🎬 Related videos:
QUERY with IMPORTRANGE:    • IMPORTRANGE Function in Google Sheets | Mu...  
More Google Sheets tutorials:    • Google Sheets Tips, Tricks & Functions  

➡️ Join this channel:    / @leilagharani  

👉 Get one practical tip each week in our newsletter: https://link.xelplus.com/yt-d-newsletter

🚩 Connect with us:
Instagram:   / lgharani  
LinkedIn:   / leilagharani  

#googlesheets #query #spreadsheets