thinkhard.SI

Prompt repository Data & spreadsheets

Combine several sheets or files into one table

Your data is split across monthly tabs, regional files or several exports, and you need one combined table that updates when new data arrives.

Registry no.
DAT-023
Collection
Data & spreadsheets
Laid out for
Any chat model
Score
10 out of 10
Blanks to fill
5
Added

Data & spreadsheetsAny chat

The prompt

Score 10 of 10, Excellent

Use it when Your data is split across monthly tabs, regional files or several exports, and you need one combined table that updates when new data arrives.

  • {{app_and_version}}
  • {{sources}}
  • {{column_match}}
  • {{purpose}}
  • {{sample}}
Full prompt and why it works
Prompt
App and version: {{app_and_version}}
The sources (tab or file names, how many, and whether more will be added): {{sources}}
Whether every source has the same columns in the same order: {{column_match}}
What I will do with the combined table: {{purpose}}

Headers and two sample rows from two of the sources:
"""
{{sample}}
"""

Task:
Show me how to combine these sources into one table in {{app_and_version}} for {{purpose}}, in a way that picks up new rows and new sources with little or no manual work.

Format:
1. Recommended method, with one sentence on why it suits my app and setup. Choose from what the app offers: for example Power Query (Get and Transform) or a VSTACK formula in Excel, or an array in curly braces, QUERY or IMPORTRANGE in Google Sheets.
2. Numbered steps, up to 12, with the app's menu names, or the formula in a code block with every part explained in plain words.
3. A Source column: how to add a column saying which tab or file each row came from, because a combined table is hard to check without it.
4. Mismatched columns: how the method handles a source whose columns differ in name or order, and how to fix it.
5. Blank rows and repeated headers: how to keep them out of the result.
6. Check it: compare the combined row count with the total of the source row counts, and give the formulas for both.
7. Next month: what I do when new data arrives.

Requirements:
- Use only features available in {{app_and_version}}. If the best method is not in my version, say so and give the next best.
- No macros or scripts unless there is no other way.
- Under 450 words, plus formulas.

Example of a check's form only: "Sources: Jan 412 rows, Feb 388, Mar 405, total 1,205. Combined table: 1,205 rows. They match."

If the samples show the sources do not line up, for example a column called "Region" in one and "Area" in another, list the differences before giving the method and ask which name to keep.

Variables

{{app_and_version}}
For example "Excel for Microsoft 365 on Windows" or "Google Sheets".
{{sources}}
For example "12 monthly tabs, Jan to Dec, in one workbook; a new tab each month" or "5 regional files in one SharePoint folder".
{{column_match}}
For example "yes", "same columns, different order" or "not sure".
{{purpose}}
For example "a pivot table of sales by region for the year".
{{sample}}
The header row and two data rows from at least two sources, labeled with the source name.

Why it works

  • What good looks like. The combined row count is checked against the total of the source counts, the quickest proof that nothing was dropped or doubled.
  • If unsure. Columns that differ between sources, such as "Region" in one and "Area" in another, are listed and asked about before any method is applied.
  • Format. A Source column on every row, and a step for next month's data, make the combined table checkable and keep it working after today.

How to use it

  1. Press Fill in variables and type your details into each blank. What you type stays in this browser.
  2. Copy the filled prompt into the AI tool you already use, such as ChatGPT, Claude or Gemini, or open it in the Grader or the Prompt Tester here.
  3. Before you rely on it, try it on three or four real examples. The Prompt Tester runs them all at once and shows which ones go wrong.
Use it from code

Get this prompt as JSON from the free REST API, with your own text in the blanks, or let an AI assistant fetch it through the MCP server. No key.

curl -s https://thinkhard.si/api/v1/prompts/combine-sheets-into-one-table

With the MCP server added to Claude, ChatGPT, Cursor or VS Code, call get_prompt with {"prompt": "combine-sheets-into-one-table"}, or just ask for it by name.