// how to
How to Use ChatGPT to Write Excel and Google Sheets Formulas
Tell ChatGPT which program you use (Excel or Google Sheets), what’s in each column with a few example rows, and the result you want in plain English. Ask for the formula and a one-line explanation of each part, then test it on rows where you already know the answer.
The short version
ChatGPT is very good at formulas when it can see what your data looks like. Describe the columns, paste three or four example rows, and say the answer you expect for one of them. That last part lets you check the formula immediately.
Step by step
- Say which program: Excel (which version, if you know) or Google Sheets. Some functions differ.
- Describe the columns: “A: date, B: customer name, C: amount, D: paid (Yes/No)”.
- Paste a few example rows. Make up the names if the real ones are private; keep the format.
- Describe the result: “In E2, show the amount if unpaid and older than 30 days, otherwise blank.”
- Ask for an explanation of each part, so you can fix it later.
- Test it on rows where you know the right answer before copying it down the whole column.
Prompts to copy
A formula:
I'm using [Excel 365 / Google Sheets]. Columns: A = date, B = customer, C = amount, D = paid (Yes/No).
Example rows:
2026-09-01 | Smith | 120 | No
2026-10-20 | Jones | 80 | Yes
In E2, I want the amount if it's unpaid and more than 30 days old, otherwise blank.
Give me the formula and explain each part in one line.
Fix an error:
This formula gives #N/A: [paste formula]. My columns are [describe]. What's wrong, and what's the fix?
Summarize data:
I have sales by date and product in columns A to C. How do I make a summary of total sales per product per month?
Explain the pivot table steps for [Excel / Google Sheets], then give me a formula alternative.
Example
For “total of column C where column B is ‘Smith’”, ChatGPT should give you =SUMIF(B:B,"Smith",C:C) and explain: look in column B for “Smith”, add up the matching values in column C. Test: add a Smith row by hand and check the total changes.
Mistakes to avoid
- Not testing. A formula that runs isn’t the same as a formula that’s right.
- Hiding your layout. Without your real column letters and a sample, ChatGPT guesses.
- Pasting confidential data. Use made-up names in your examples; the formula works the same.
When not to use it
For financial reports, tax figures or payroll, have the final spreadsheet checked by someone who knows the numbers. A small formula mistake copied down a column can be expensive.
Related: use ChatGPT for your small business.
Frequently asked questions
Why doesn't the formula from ChatGPT work in my sheet?
Usually because ChatGPT guessed your columns, your program or your region's separator (some regions use semicolons instead of commas). Paste the exact error and a few sample rows and ask it to fix the formula.
Can ChatGPT analyze my spreadsheet directly?
You can attach a spreadsheet file and ask questions about it. For sensitive data, like customer details or payroll, think first about whether you're allowed to share it.
Free download
Get the AI Coding Starter Kit
A PDF you can use with any AI coding assistant: a project-rules template, 25 tested prompt patterns, a team adoption checklist and an assistant comparison sheet. The editable Markdown sources are included.
- Works with Copilot, Claude Code, Codex, Cursor and more
- Double opt-in, one-click unsubscribe
- No trackers, never shared