Skip to content

Guides

AI for spreadsheets: describe the result, get the formula

You know what the sheet should show; GPT knows the function names. Describe your columns and the result you want, and it writes the formula, explains it and helps you track down the error when it breaks.

6 min readUpdated

Spreadsheets reward people who remember function names and punish everyone else. You know exactly what you want the sheet to show; the hard part is translating that into the right combination of brackets, commas and cell references. GPT is good at that translation. Describe your columns and the result you want in plain words, and it writes the formula, explains each piece and helps you fix it when it returns an error. This guide shows how to ask in GBT Chat for Excel and Google Sheets, and what to check before you trust the result.

Describe the sheet before you ask

The model cannot see your file. Our chat does not accept spreadsheet files, so you have to tell it how the data is laid out. Three things are enough:

  • Which program: Excel (and roughly which version) or Google Sheets. Some functions exist in one and not the other.
  • The layout: which columns hold what, where the headers are, how many rows.
  • A few sample rows: paste them as text, with private data replaced by made-up values.

A screenshot also works. Press + in the composer and attach a picture of the relevant part of the sheet, with the column letters and row numbers visible. Both models can read it, but keep it cropped and sharp so the numbers are legible.

From plain words to a formula

Weak:
How do I add up sales?

Strong:
Google Sheets. Column A has dates, column B the salesperson's name,
column C the amount. Rows 2 to 500. In F2 I want the total amount
for the name typed in E2, but only for dates in the current month.
Give me the formula and explain each part in one line.

The strong version names the program, the columns, the range and the exact condition. The model can then give a single formula that fits, rather than a general lesson on adding numbers. Asking for a one-line explanation of each part means you learn the pattern and can adapt it next time. Open this example and change it to match your own sheet.

Useful variations:

  • "Give me two ways to do this, one with a simple function and one with a more flexible one, and say when each is better."
  • "Rewrite this formula so it also works when the cell is empty."
  • "Explain this formula I found in our team's sheet, step by step." Then paste it.

Fixing errors

When a formula returns an error or a wrong number, give the model everything it needs to see the problem:

This Excel formula in D2 returns #N/A for some rows but not others:
[paste formula]
Column A in this sheet has product codes like "AB-104". The lookup
table on the Prices sheet has codes in column A and prices in column B.
Here are three rows where it fails: [paste]. What is causing it?

Pasting the rows that fail is the key detail. Common causes such as extra spaces, numbers stored as text or a range that does not stretch far enough often show up in the sample data. For stubborn problems, switch on Think; GPT-6.1 Terra works through the formula step by step before it answers and is better at spotting the subtle cause.

Cleaning messy data

Imported data is rarely tidy: names in capitals, dates in three formats, phone numbers with and without spaces, duplicates. Ask for a cleaning plan rather than one giant formula:

  • "Column B has names in mixed case, some with extra spaces. Give me a formula for a helper column that fixes both."
  • "Dates in column A are a mix of 03/04/2026 and 2026-04-03 text. How do I turn them all into real dates? Assume day comes before month."
  • "How do I find and highlight duplicate email rows without deleting anything yet?"
  • "Split full names in column A into first and last name, keeping middle names with the first name."

Always work on a copy of the data, and keep the original column until you have checked the cleaned one. A single wrong assumption, like day and month the wrong way round, can quietly change thousands of cells.

Pivot tables and summaries

Pivot tables are the fastest way to answer questions like "sales by region and month", but the menus confuse many people. Describe the question you want answered and ask for steps:

Excel. I have a table of orders with columns Date, Region, Product,
Quantity and Revenue. I want to see total revenue per region per
month, with the biggest region at the top. Walk me through making a
pivot table for this, click by click, and tell me how to group the
dates by month.

If you prefer formulas over pivot tables, ask for that instead: "Give me a formula-based summary table that updates automatically." Our Excel prompts have more ready-made requests for summaries and reports.

Charts that make the point

The right chart depends on the message, not the data. Tell the model what you want the reader to notice:

  • "I want to show that costs rose faster than income over 12 months. Which chart type and how should I set it up?"
  • "Our survey has five answer options for ten questions. What is a clear way to chart this for a slide?"
  • "Suggest a title for this chart that states the finding, not just the topic."

The chat cannot draw the chart for you, but it can tell you exactly which chart to pick, which columns to select and which settings to change.

Test every formula on rows you can check by hand. Before you fill a formula down 2,000 rows, try it on three rows where you already know the right answer. If those match, fill it down. If they do not, paste the three rows and the result back into the chat.

Beyond formulas: scripts and SQL

For repetitive tasks, the model can write short macros for Excel or Apps Script for Google Sheets. Ask what the script does line by line before you run it, and test it on a copy of the file, because a script can change many cells at once and there may be no undo. If your data lives in a database rather than a sheet, the SQL helper turns plain questions into queries, and the code explainer walks through any script you were given. Office workers will find more ideas on our page for office workers.

Keep company data in mind as you work. Remove customer names, salaries and anything confidential from the rows you paste; made-up sample values work just as well for building a formula.

FAQ

Can I attach my Excel file to the chat?

No, our chat accepts images only, not spreadsheet files. Paste a few rows as text or attach a screenshot of the relevant area with column letters visible.

Does it know the difference between Excel and Google Sheets?

Yes, but only if you say which one you use. Most common functions work in both; some newer or specialised ones do not. Mention your program in the first line.

Why does the formula use commas when my Excel needs semicolons?

Some regional settings use semicolons as separators. Tell the model "my Excel uses semicolons" and it will rewrite the formula accordingly.

Can it calculate totals for me directly?

It can, but language models make arithmetic slips with long lists of numbers. Let the spreadsheet do the maths with a formula; use the chat to write and explain the formula.

Which model should I pick?

GPT-6 Luna is fine for most formulas. Use Think for debugging, complex nested conditions and scripts, where a careful step-by-step check pays off.

Your question, answered now

No account, no card, nothing to download. Type what you want to know and the first words of the answer appear in a second or two.

Start a chat