Quick answer: You use ChatGPT for Excel and Google Sheets formulas by describing your columns, what you want calculated and which program you're using, then pasting the formula it writes into a cell and testing it on a few rows. ChatGPT can also explain existing formulas and diagnose errors like #N/A or #VALUE!.
Key takeaways
- Describe your columns and the exact result you want
- Always name Excel or Google Sheets
- Test every formula on rows you can check by hand
You know exactly what you want the spreadsheet to do. You just can't remember whether it's VLOOKUP, INDEX MATCH or something with an ampersand, and the forum answer you found uses a function your version doesn't have. Formulas are a language, and most of us only speak it a little. ChatGPT is a decent translator. You describe the result in plain English, and it hands back a formula plus an explanation of how it works. It's not perfect, and it can't see your file unless you describe it. But used carefully, it turns thirty minutes of searching into two.
1. Describe your sheet, not just your goal
ChatGPT can't see your spreadsheet, so describe it. Say which program you use, since Excel and Google Sheets differ on some functions. Then list your columns by letter and what each holds: "A is order date, B is customer name, C is amount." Say where your data starts and ends. A tiny sample of five fake rows helps a lot.
Then state the result in plain words. "In column F, show Paid if column D has a date, otherwise Overdue" is much better than "track payments." The more your request reads like instructions to a coworker who can't see your screen, the more accurate the formula will be.
2. Ask for the formula and the explanation
Always ask for two things: the formula and a short explanation of each part. The explanation is how you learn, and it's how you spot mistakes. If the formula uses a function you don't recognize, ask why it picked it and whether a simpler option exists. You'll often get a cleaner version, like XLOOKUP instead of a nested VLOOKUP.
Check which functions your version supports. XLOOKUP, FILTER and LET exist in newer Excel and in Google Sheets, but not in very old Excel versions. If a formula returns a name error, tell ChatGPT your version and ask for an alternative that works there.
3. Test it before you fill it down
Paste the formula into one cell, then check the result against a row you can calculate by hand. Try a blank cell, a duplicate and a weird entry, because real data is messier than examples. Only after those tests should you drag the formula down a thousand rows.
When something breaks, paste the formula and the exact error message back into the chat, along with a sample of the data in the cells it references. Ask what's wrong and why. Common culprits are numbers stored as text, extra spaces, and ranges that don't lock with dollar signs when you copy them.
4. Use it for cleanup, explanations and bigger jobs
ChatGPT also helps beyond single formulas. Paste a formula you inherited and ask for a line-by-line explanation. Ask how to split full names into two columns, remove extra spaces, standardize dates, or flag duplicates. For Google Sheets, it can also help draft Apps Script for repeated tasks, and for Excel, it can suggest pivot table setups.
For anything repetitive, ask for the steps in plain numbered form and follow them yourself on a copy of your file. Working on a copy means a mistake costs you nothing. And if your sheet contains private data, replace real names and numbers with dummy samples before sharing structure with ChatGPT.
A weak prompt vs. a better one
You track client invoices and want a status column that updates itself.
Weak prompt:
Better prompt:
The weak version doesn't say which program, which columns or what overdue means. The better one defines every rule. You should get a nested IF formula using TODAY() with a plain explanation. Test it with a paid row, an old unpaid row and a recent unpaid row.
A prompt you can copy and use
Paste this into ChatGPT, Claude or Gemini and replace the parts in brackets with your own details:
Mistakes and limits to know about
ChatGPT can write formulas that look right and quietly return wrong results, so never trust one on important numbers without testing. It can also mix up Excel and Google Sheets syntax if you don't specify. Don't upload or paste sensitive spreadsheets, such as payroll, customer records or health data, and check your workplace's AI rules before sharing company files. Keep a backup before pasting anything into a working file. For financial reports or anything audited, have a person who knows the data review the logic as well.
Keep learning
If you are new to this, start with our beginner's guide to learning AI. These related articles may help too: 7 Realistic Ways to Make Money With AI (No Hype) and How to Write a Resume With ChatGPT (and What Not to Let It Do).
Frequently asked questions
Can ChatGPT write Excel formulas?
Yes. Describe your columns, the result you want and your Excel version, and it can write the formula and explain it. Test the formula on a few rows you can check by hand before using it widely, because it can occasionally produce one that looks correct but returns the wrong values.
Is ChatGPT good for Google Sheets?
Yes, it works well for Google Sheets formulas, including ARRAYFORMULA, QUERY and IMPORTRANGE, which are specific to Sheets. Mention that you're using Google Sheets so it doesn't give you Excel-only syntax. It can also help draft simple Apps Script for repeated tasks, though you should test scripts on a copy.
Why is my ChatGPT formula giving an error?
Common causes are the wrong program syntax, a function your Excel version lacks, numbers stored as text, or mismatched ranges. Paste the formula, the exact error and a sample of the referenced cells back into ChatGPT and ask it to diagnose. Mentioning your version often solves it right away.
Can I upload my spreadsheet to ChatGPT?
Some versions let you upload files, but think before you do. If the sheet has personal, financial or confidential data, don't. A safer option is to describe your column structure and paste a few dummy rows. That gives ChatGPT enough to write a formula without exposing real information.
Want ready-made prompts?
Download the free PDF with 10 tested prompts on this topic: AI prompts for excel and google sheets. You can also browse all of our free AI prompt guides.
Last updated: October 2026. Written by the Learn AI Smart team. Always check AI output before you use it.