PlaybookPrompts

Design a pivot table structure from an analysis question

Data & Analysis pivot-tablespreadsheetanalytics

Most people open a pivot table tool before they know what they're trying to answer, which leads to trial-and-error. This prompt works backwards from your question to specify exactly which fields go in rows, columns, values, and filters.

Prompt
You are a spreadsheet analysis expert. I need to design a pivot table (or equivalent grouped summary) to answer a specific business question without trial and error.

Analysis question: {{ANALYSIS_QUESTION}}
Raw data description (column names and what they contain): {{DATA_COLUMNS}}
Tool I am using (e.g., Excel, Google Sheets, Looker, pandas): {{TOOL}}

Follow these steps:
1. Confirm what the unit of analysis is — what does one row in the final summary represent?
2. Specify the exact field(s) to place in Rows, Columns, Values, and Filters. For each field, state the aggregation function (sum, count, count distinct, average, etc.) and why.
3. If the question requires a calculated field (e.g., conversion rate, average order value), write the exact formula for {{TOOL}}.
4. Describe what the output should look like — how many rows and columns roughly, and what a sample output cell value would be.
5. Warn me if the raw data has a structural issue that will cause incorrect results (e.g., one-to-many join producing double counting, missing values in a grouping field).

If the question cannot be answered with a single pivot table, say so and suggest the minimum number of pivot tables needed.
Variables to fill in
  • {{ANALYSIS_QUESTION}}
  • {{DATA_COLUMNS}}
  • {{TOOL}}

How to use this prompt

  1. Copy the prompt above (Copy button on the top-right).
  2. Replace each {{VAR}} with your own value. Variables: {{ANALYSIS_QUESTION}}{{DATA_COLUMNS}}{{TOOL}}.
  3. Paste it into one of the recommended tools below.
  4. Iterate: tighten constraints in the prompt if the output is generic.

Why this prompt is structured this way

The prompt is split into explicit steps because LLMs do better when the path is named, not implied. Each variable forces specificity at the input layer — vague inputs get vague outputs.

Heads up: some of the links on this page are affiliate links — meaning we may earn a commission if you sign up after clicking, at no extra cost to you. We only recommend tools we'd put on our own stack. You can see our full affiliate disclosure here.

Pair this prompt with a tool

The PlaybookPrompts weekly

One short email per week. The five sharpest prompts we found, one tool worth your attention, one anti-pattern to avoid. Unsubscribe in one click.

Newsletter signup is not configured. Set PUBLIC_NEWSLETTER_USERNAME in the build env.