Pivot Tables and Data Summarization with AI
Create pivot tables and data summaries using AI. Learn to analyze thousands of rows with plain English prompts — no memorizing dialog boxes.
You have 10,000 rows of sales data. Your boss wants a summary by region and quarter — in 15 minutes. Pivot tables are the answer, but the dialog box looks like a cockpit control panel.
What if you could just say “show me total sales by region and quarter” and get the result?
🔄 Quick Recall: In the previous lesson, you learned to describe lookup needs in plain English. The same approach works for pivot tables: describe the summary you want, and AI handles the mechanics.
Two Approaches to AI Pivot Tables
Approach 1: AI Guides You Through the Pivot Table Dialog
Ask AI for step-by-step instructions:
Prompt:
“I have a Google Sheet with columns: Date, Region, Salesperson, Product, Quantity, Revenue. Walk me through creating a pivot table that shows total Revenue by Region (rows) and quarter of the Date (columns).”
AI responds with exact steps: where to click, which fields to drag where, and how to configure the value aggregation. This works when you want to learn the tool itself.
Approach 2: AI Creates Formula-Based Summaries
Instead of a pivot table, AI can generate formulas that produce the same result:
Prompt:
“In Google Sheets, I have data in Sheet1 columns A through F: Date (A), Region (B), Salesperson (C), Product (D), Quantity (E), Revenue (F). Create a QUERY formula that shows total Revenue grouped by Region, sorted from highest to lowest.”
AI generates:
=QUERY(Sheet1!A1:F, "SELECT B, SUM(F) WHERE B IS NOT NULL GROUP BY B ORDER BY SUM(F) DESC LABEL SUM(F) 'Total Revenue'")
This is a live formula — it updates automatically when you add new data. Traditional pivot tables need manual refreshing.
✅ Quick Check: What’s the advantage of a QUERY formula over a traditional pivot table? (Answer: QUERY formulas update automatically when source data changes, while traditional pivot tables need to be manually refreshed.)
The QUERY Function: Pivot Tables as Formulas
Google Sheets’ QUERY function is the most powerful function in the platform. It uses SQL-like syntax that AI handles perfectly.
Common QUERY patterns:
| What You Want | Ask AI For |
|---|---|
| Group and sum | “QUERY that sums Revenue grouped by Region” |
| Filter then group | “QUERY that sums Revenue for 2026 only, grouped by month” |
| Multiple aggregations | “QUERY showing COUNT of orders and SUM of revenue by product” |
| Pivot (cross-tab) | “QUERY that pivots Region as columns and Month as rows, with SUM of revenue” |
| Top N | “QUERY showing top 5 products by total revenue” |
Example — Monthly revenue by region (cross-tab):
Prompt:
“Create a QUERY formula that shows months as rows and regions as columns, with total revenue as values. Data is in A1:F with Date in column A and Region in column B and Revenue in column F.”
AI generates:
=QUERY(A1:F, "SELECT MONTH(A)+1, SUM(F) WHERE A IS NOT NULL GROUP BY MONTH(A)+1 PIVOT B")
Excel equivalent: In Excel, you’d use a regular pivot table or Power Query. Tell AI “I’m in Excel” and it will guide you through the PivotTable dialog or suggest SUMIFS-based alternatives.
✅ Quick Check: What SQL keyword does the QUERY function use to create cross-tab summaries (like regions as columns)? (Answer: PIVOT — it rotates row values into column headers.)
Summarization Beyond Pivot Tables
Sometimes you don’t need a full pivot table — just quick summary stats. AI generates these instantly:
Prompt:
“I have order data in columns A through F. Create formulas that show: (1) total number of orders, (2) total revenue, (3) average order value, (4) highest single order, (5) number of unique customers in column C.”
AI generates a set of summary formulas you can place in a dashboard area of your sheet.
For more complex summaries, combine SUMIFS with AI:
Prompt:
“Create a summary table that shows, for each Region in column B: total Revenue (column F), average Revenue, number of orders, and the percentage of total revenue. Data runs from row 2 to 5000.”
Conditional Summaries
The real power comes from combining grouping with conditions:
Prompt:
“Using QUERY in Google Sheets, show total revenue by Product (column D) but only for orders where Quantity (column E) is greater than 10 and Region (column B) is ‘West’. Sort by revenue descending.”
AI generates:
=QUERY(A1:F, "SELECT D, SUM(F) WHERE E > 10 AND B = 'West' GROUP BY D ORDER BY SUM(F) DESC LABEL SUM(F) 'Revenue'")
Try building that manually — it would take several minutes of dialog box clicking. With AI, it’s one prompt.
Practice Exercise
Using sales data (or create sample data with 50+ rows):
- Ask AI to create a QUERY formula showing total sales by product category
- Ask AI to create a cross-tab with months as rows and categories as columns
- Ask AI for a summary dashboard: total revenue, order count, average order value, top product
- Compare: create the same summary using a traditional pivot table — which was faster?
Key Takeaways
- AI handles pivot tables two ways: guiding you through the dialog, or generating QUERY formulas
- Google Sheets’ QUERY function creates dynamic pivot tables that auto-refresh
- Describe what you want to see (rows, columns, values, filters) in your prompt
- Always verify pivot table totals against a simple SUM of the raw data
- For Excel users, tell AI you’re in Excel and it will suggest PivotTable steps or SUMIFS
Up Next
In the next lesson, you’ll turn your data and summaries into visual stories — charts, dashboards, and data visualizations created with AI assistance.
Knowledge Check
Complete the quiz above first
Lesson completed!