| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | QUERY Function Pillar Guide — Companion Workbook | |||||||||||||||||||||||||
2 | ||||||||||||||||||||||||||
3 | About this workbook | |||||||||||||||||||||||||
4 | This workbook contains sample datasets designed to be used with the QUERY function in Google Sheets. | |||||||||||||||||||||||||
5 | The QUERY function is native to Google Sheets and does NOT work in Microsoft Excel. | |||||||||||||||||||||||||
6 | To use this workbook: | |||||||||||||||||||||||||
7 | 1. Save this file to Google Drive | |||||||||||||||||||||||||
8 | 2. Right-click → Open with → Google Sheets (converts to native Sheets format) | |||||||||||||||||||||||||
9 | 3. Copy any QUERY formula from the pillar guide and paste into a blank cell | |||||||||||||||||||||||||
10 | 4. QUERY formulas will operate on the sample data in this workbook | |||||||||||||||||||||||||
11 | ||||||||||||||||||||||||||
12 | Sheets in this workbook | |||||||||||||||||||||||||
13 | ||||||||||||||||||||||||||
14 | Sheet Name | Description | Size | |||||||||||||||||||||||
15 | Sales_Data | Denormalized sales transactions — primary dataset for most QUERY examples | 70 rows | |||||||||||||||||||||||
16 | Customers | Customer master data with tier, region, and lifetime value | 20 rows | |||||||||||||||||||||||
17 | Products | Product catalog with category, price, and stock level | 12 rows | |||||||||||||||||||||||
18 | Query_Reference | 20+ ready-to-use QUERY formulas covering all common patterns | reference | |||||||||||||||||||||||
19 | ||||||||||||||||||||||||||
20 | About QUERY | |||||||||||||||||||||||||
21 | QUERY is Google Sheets' most powerful function. It uses SQL-like syntax to filter, | |||||||||||||||||||||||||
22 | sort, aggregate, and reshape data in a single formula. It replaces what would take | |||||||||||||||||||||||||
23 | 10+ formulas in Excel with a single expressive query. | |||||||||||||||||||||||||
24 | Syntax: =QUERY(data, query_string, [headers]) | |||||||||||||||||||||||||
25 | ||||||||||||||||||||||||||
26 | Note on Query_Reference sheet | |||||||||||||||||||||||||
27 | Formulas in the Query_Reference sheet have a leading space (' =QUERY...') to prevent | |||||||||||||||||||||||||
28 | Excel from parsing them as broken formulas. When copying to Google Sheets, remove | |||||||||||||||||||||||||
29 | the leading space. Or copy formulas directly from the pillar guide's copy buttons. | |||||||||||||||||||||||||
30 | ||||||||||||||||||||||||||
31 | Learn more | |||||||||||||||||||||||||
32 | Full guide: https://sheetsandcells.com/sheets/guides/query-complete-guide/ | |||||||||||||||||||||||||
33 | ||||||||||||||||||||||||||
34 | Built by Zain Khan · Rawalpindi, Pakistan | |||||||||||||||||||||||||
35 | ||||||||||||||||||||||||||
36 | ||||||||||||||||||||||||||
37 | ||||||||||||||||||||||||||
38 | ||||||||||||||||||||||||||
39 | ||||||||||||||||||||||||||
40 | ||||||||||||||||||||||||||
41 | ||||||||||||||||||||||||||
42 | ||||||||||||||||||||||||||
43 | ||||||||||||||||||||||||||
44 | ||||||||||||||||||||||||||
45 | ||||||||||||||||||||||||||
46 | ||||||||||||||||||||||||||
47 | ||||||||||||||||||||||||||
48 | ||||||||||||||||||||||||||
49 | ||||||||||||||||||||||||||
50 | ||||||||||||||||||||||||||
51 | ||||||||||||||||||||||||||
52 | ||||||||||||||||||||||||||
53 | ||||||||||||||||||||||||||
54 | ||||||||||||||||||||||||||
55 | ||||||||||||||||||||||||||
56 | ||||||||||||||||||||||||||
57 | ||||||||||||||||||||||||||
58 | ||||||||||||||||||||||||||
59 | ||||||||||||||||||||||||||
60 | ||||||||||||||||||||||||||
61 | ||||||||||||||||||||||||||
62 | ||||||||||||||||||||||||||
63 | ||||||||||||||||||||||||||
64 | ||||||||||||||||||||||||||
65 | ||||||||||||||||||||||||||
66 | ||||||||||||||||||||||||||
67 | ||||||||||||||||||||||||||
68 | ||||||||||||||||||||||||||
69 | ||||||||||||||||||||||||||
70 | ||||||||||||||||||||||||||
71 | ||||||||||||||||||||||||||
72 | ||||||||||||||||||||||||||
73 | ||||||||||||||||||||||||||
74 | ||||||||||||||||||||||||||
75 | ||||||||||||||||||||||||||
76 | ||||||||||||||||||||||||||
77 | ||||||||||||||||||||||||||
78 | ||||||||||||||||||||||||||
79 | ||||||||||||||||||||||||||
80 | ||||||||||||||||||||||||||
81 | ||||||||||||||||||||||||||
82 | ||||||||||||||||||||||||||
83 | ||||||||||||||||||||||||||
84 | ||||||||||||||||||||||||||
85 | ||||||||||||||||||||||||||
86 | ||||||||||||||||||||||||||
87 | ||||||||||||||||||||||||||
88 | ||||||||||||||||||||||||||
89 | ||||||||||||||||||||||||||
90 | ||||||||||||||||||||||||||
91 | ||||||||||||||||||||||||||
92 | ||||||||||||||||||||||||||
93 | ||||||||||||||||||||||||||
94 | ||||||||||||||||||||||||||
95 | ||||||||||||||||||||||||||
96 | ||||||||||||||||||||||||||
97 | ||||||||||||||||||||||||||
98 | ||||||||||||||||||||||||||
99 | ||||||||||||||||||||||||||
100 |