How to Create a Pivot Table in Excel with AI

Cody Schneider

Creating a Pivot Table in Excel often feels like a rite of passage for anyone working with data, but it can also be the point where many people get stuck. If you've ever found yourself dragging and dropping fields with no idea what goes into the "Rows," "Columns," or "Values" boxes, you're not alone. This guide will show you how to skip the complicated setup entirely by using Excel’s built-in AI to build powerful pivot tables just by asking questions in plain English.

So, What Exactly Is a Pivot Table?

Think of a pivot table as a smart summary tool. Imagine you have a spreadsheet with hundreds or thousands of rows of sales data: every transaction, an order date, a customer name, a product, a region, and a sales amount. Finding meaningful information in that giant list is nearly impossible at a glance.

A pivot table lets you instantly rearrange, or "pivot," that data to answer key questions. For example, you could use it to see:

  • Total sales revenue for each region.

  • Which products are the top sellers?

  • The average order value for each month.

  • How many units each salesperson sold.

Instead of writing complex formulas like SUMIFS or COUNTIFS, a pivot table does all the heavy lifting for you, turning that messy raw data into a clean, organized summary that’s easy to understand.

The Old Way vs. The AI-Powered Way

Traditionally, creating a pivot table involves a manual drag-and-drop process. You select your data, go to Insert > PivotTable, and then you’re faced with the PivotTable Fields pane. You have to decide which data fields to place in the Filters, Columns, Rows, and Values areas. While powerful, this is exactly where the confusion starts for many users. What goes where? Why isn't it adding up correctly?

The AI-powered way flips this on its head. Instead of figuring out how to build the table, you just tell Excel what you want to know. You ask, "Show me total sales by city," and Excel builds the corresponding pivot table for you. This functionality, called "Analyze Data," acts like a data analyst sitting right inside your spreadsheet.

Step 1: Get Your Data Ready for AI

Before you unleash Excel’s AI, you need to make sure your data is set up in a way it can understand. This is the most important step, as good data structure leads to accurate results. Fortunately, the rules are simple.

Organize Your Data in a Tabular Format

Your data should be organized like a simple database table. This means:

  • One Header Row: The very first row should contain unique, descriptive names for each column (e.g., "Order Date," "Product Category," "Revenue").

  • No Blank Rows or Columns: The AI uses the continuous range of data to understand its scope. Avoid having completely empty rows or columns cutting through your dataset.

  • One Piece of Information Per Cell: Don't cram multiple data points into a single cell, like putting "New York, USA" in the city column. It's better to have separate columns for "City" and "Country."

Use Consistent Data Types

Ensure that each column contains the same type of data all the way down. The "Revenue" column should only contain numbers, the "Order Date" column should only contain dates, and so on. Inconsistent data, like text appearing in a sales column, can throw off calculations.

Pro-Tip: Format Your Data as a Table

This is an optional but highly recommended step. By formatting your data as an official Excel Table, it becomes a dynamic object. Click anywhere inside your data range and press Ctrl + T (or Cmd + T on a Mac). In the dialog box that appears, make sure "My table has headers" is checked and click OK.

Now, if you add new rows of data later, the AI tool will automatically include them in its analysis without you having to manually adjust the data range. It’s a simple trick that saves a lot of headaches.

Step 2: Create a Pivot Table with "Analyze Data"

Once your data is clean and organized, the fun part begins. Here's a step-by-step walkthrough of how to use the "Analyze Data" feature.

1. Select Your Data

Click on any single cell within your data range. If you formatted it as a Table in the previous step, this is all you need to do, as Excel already knows where the table begins and ends.

2. Open the "Analyze Data" Pane

On the Home tab of the Excel ribbon, look all the way to the right for a button called Analyze Data (it may have a lightning bolt icon). Click it.

A new "Analyze Data" pane will pop up on the right side of your screen. This is where the magic happens.

3. Review Excel's Automated Suggestions

Immediately, Excel’s AI gets to work and scans your data for interesting patterns. It will automatically generate several charts and pivot table summaries it thinks you might find useful. For example, with sales data, it might suggest "Total Revenue by Region" or "Count of Products by Category."

You can scroll through these suggestions and, if you see one you like, simply click the + Insert PivotTable button below it to add it to a new worksheet.

4. Ask a Natural Language Question

This is the most powerful feature. At the top of the "Analyze Data" pane, you'll see a text box that says, "Ask a question about your data." Instead of relying on the pre-built suggestions, you can type your own question in plain English.

Here are some examples of what you could ask, using column header names to guide the AI:

  • For total values: total sales by product category

  • For counts: how many orders per country?

  • For averages: average shipping cost by shipping method

  • For filtered data: top 5 salespeople by revenue in Q4

As you type, Excel will try to autocomplete your question. Once you ask your question and press Enter, the AI will generate a small preview of the answer. If it looks correct, click the + Insert PivotTable button. Voila! Excel adds a new, perfectly structured pivot table to your workbook that answers your exact question.

The best part is that this isn't a static image or a one-time result. It is a fully functional, refreshable pivot table. You can still modify it, add slicers, or change its formatting just like any pivot table you'd build manually.

Tips for Writing Effective Prompts

Getting the best results from the AI often comes down to how you phrase your questions. Here are a few quick tips to help you get started:

  • Use the Names from Your Column Headers: If your sales column is named "Revenue," use the word "revenue" in your prompt (e.g., "total revenue by region"). This helps the AI map your question directly to your data.

  • Keep It Simple and Specific: Ask one question at a time. Instead of "Show me the top products and total sales by country," break it into two separate questions: "What are the top 5 products by sales?" and "What is the total sales by country?"

  • Experiment: Don't be afraid to try different ways of asking a question. If one prompt doesn't give you what you want, rephrase it. Sometimes changing "sales" to "sum of sales" or "orders" to "count of orders" is all it takes.

Final Thoughts

Excel's "Analyze Data" feature fundamentally changes how we approach data analysis, making one of its most powerful tools - the pivot table - infinitely more accessible. By simply asking what you want to know in plain English, you can summarize complex data in seconds, freeing you up to focus on finding insights rather than fumbling with fields and settings.

While this AI feature streamlines analysis within a single spreadsheet, the initial legwork of gathering and combining that data from various sources like Google Analytics, Shopify, and your CRM still often involves manual CSV exports and tedious copy-pasting. That’s why we built Graphed. We wanted to extend that same natural language experience beyond the spreadsheet by connecting directly to all your favorite marketing and sales apps. This allows you to ask questions across multiple live data sources at once and instantly build real-time dashboards, so you never have to download another CSV to get the answers you need.