How to Use ChatGPT for Excel Formulas (and Check Them)
By ExcelReady TeamUpdated 6 min read
The short answer
Describe your sheet precisely: the columns, the rows, your Excel version and the result you expect for one row. Ask ChatGPT or another AI chatbot for the formula and an explanation of each part. Then test it on a few rows you can check by hand. Never use a formula you can't read, because a wrong one still looks right.
Key takeaways
- Name the exact columns, rows, header row and Excel version in your prompt, plus one example of the right answer.
- Ask the chatbot to explain each part of the formula, so you learn it and can spot a wrong step.
- Check every AI formula on two or three rows you work out by hand, including blanks and edge cases.
- Common slips: wrong ranges, missing FALSE in VLOOKUP, functions your version doesn't have, and the wrong separator.
- Don't paste confidential data into a chatbot. Describe the layout with made-up sample rows instead.
On this page+
Using ChatGPT for Excel formulas works well when you treat the chatbot as a fast first draft, not as the final answer. Describe your sheet precisely, ask for the formula and an explanation, then test it on rows you can check by hand. This guide shows a prompt template, a quick checking routine and the mistakes AI-written formulas most often contain.
The same steps apply to any AI chatbot, including the assistants built into some spreadsheet apps.
How to use ChatGPT for Excel formulas#
Think of the process as three steps: describe, ask, test. Skipping the last step is where people get into trouble, because a wrong formula doesn't show an error. It just shows a wrong number.
- Describe the sheet. Say which columns hold what, where the data starts and ends, and which Excel version you use.
- Ask for the formula and an explanation. The explanation lets you see the logic, not just the result.
- Test it. Put the formula in your sheet and compare it with two or three answers you work out yourself.
If you're new to formulas, learn the basic parts first: the equals sign, cell references and how a function takes arguments. The guide to what a function is in Excel covers this in a few minutes, and it makes every AI answer easier to read.
How to write a good prompt for an Excel formula#
A good prompt gives the chatbot the same facts a colleague would need to write the formula for you. Vague prompts like "sum sales by region" force it to guess your layout, and the guess is often wrong.
Include these five things:
| What to include | Example |
|---|---|
| Column letters and contents | "A is Rep, B is Region, C is Quarter, D is Sales" |
| Data rows | "Headers in row 1, data in rows 2 to 8" |
| Your Excel version | "Excel 2016 for Windows" or "Microsoft 365" |
| Where the answer goes | "The formula goes in G2" |
| One expected result | "For North in Q1 the answer should be 2,650" |
Here is a full prompt built from that table:
My sheet has Rep in A, Region in B, Quarter in C and Sales in D. Headers are in row 1 and data is in rows 2 to 8. I use Microsoft 365. In G2, I want the total sales where Region is North and Quarter is Q1. The answer should be 2,650. Give me the formula and explain each part.
A typical reply is =SUMIFS(D2:D8,B2:B8,"North",C2:C8,"Q1"), with a note that the first range is the numbers to add and each pair after it is a column and its condition. That explanation is the valuable part. Read it and make sure each range points at the column you mean.
Two more prompt tips help a lot. Ask for "a formula that works in Excel 2016" if you don't have Microsoft 365, so you don't get functions you can't use. And if a formula fails, paste the exact error and the formula back into the chat, rather than just saying "it doesn't work".
How to check a formula ChatGPT gives you#
Check every AI formula against answers you know are right before you trust it. This takes a minute and catches most problems.
- Hand-check two or three rows. Pick rows where you can work out the answer yourself. In the example, North Q1 is 1,200 + 800 + 650 = 2,650. If the formula agrees, that's a good sign.
- Test the edge cases. Add a blank row, a zero, a duplicate name or a number stored as text, and see if the result still makes sense.
- Look at the ranges. Click the cell and press F2. Excel colours each range on the sheet, so you can see if one stops a row short.
- Step through it. In Excel for Windows, Formulas > Evaluate Formula calculates the formula one part at a time. The guide to tracing and evaluating formulas shows how.
- Show all formulas. Click Formulas > Show Formulas, or press Ctrl with the grave accent key (left of 1) on Windows, or Control with the same key on a Mac. Every formula appears at once. The article on how to show formulas in Excel has more on this.
A formula that runs without an error can still be wrong. The Debugging SUM lesson trains exactly this skill: it gives you totals that look fine and asks you to find the bug.
Common mistakes in AI-written Excel formulas#
Most wrong AI formulas fail in a handful of predictable ways. Knowing them makes your checks faster.
| Mistake | What you see | Fix |
|---|---|---|
| Ranges that don't match your sheet | A total that misses rows, or #VALUE! | Give the exact rows in your prompt and check each range |
| VLOOKUP without FALSE | Wrong matches on unsorted data, with no error | Add FALSE as the 4th argument for an exact match |
| A function your version lacks | #NAME? | Tell the chatbot your version, or ask for an older alternative |
| Comma vs semicolon separators | Excel rejects the formula | Use the separator your region uses, often ; in Europe |
| Text where a number should be | "100" in quotes compares as text | Remove the quotes around numbers |
| A function that doesn't exist | #NAME? | Ask which Microsoft function it is, then check Microsoft Support |
If you see an error you don't recognise, the list of Excel error types explains what each one means. For formulas that Excel refuses to accept at all, see what "There's a problem with this formula" means.
Ask it to explain, not just write#
The fastest way to get better at Excel with a chatbot is to ask "why" after every answer. Try prompts like these:
- "Explain each argument of this formula in one line."
- "What happens if one of the cells is blank?"
- "Show me a simpler version that works in Excel 2016."
- "What would make this formula return the wrong answer?"
The last question is especially useful. It pushes the chatbot to list the edge cases, and you can then test them. You can also do it the other way round: paste a formula from a work file and ask what it does. That helps you understand inherited spreadsheets, but still confirm the answer on real rows.
Keep confidential data out of the chat#
Don't paste salaries, customer names or other private data into a chatbot unless your employer has approved that tool for that data. You rarely need real data to get a good formula.
Instead, describe the columns and type three or four made-up rows that have the same shape as your real ones. The formula works the same way on the real sheet, because it only cares about where the data sits, not what it says.
Why you still need to understand the formula#
You need to read a formula to check it, and you need to check it before you use it. If you can't tell what B2:B8 or "Q1" does in a formula, you can't tell when it's wrong.
There is a career reason too. Job Excel tests and interviews ask you to write formulas yourself, usually with no outside help. If you're not sure how your skills stand, the Excel level test gives you a quick, honest starting point.
Practise it#
AI can draft a formula, but you need to be able to write and check one yourself. Practise your first formulas in a live spreadsheet: you type each formula and it is checked instantly. Then practise finding wrong totals in the Debugging SUM lesson, the skill that makes every AI answer safe to use. Or start with the exercise on this page.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
A chatbot suggested =SUMIFS(D2:D8,B2:B8,"North",C2:C8,"Q1") to total North sales in Q1. Type it in G2, press Enter, then check it by hand: the North Q1 rows are Ana, Dev and Finn.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Sales | |||||||
| 2 | North Q1 sales | |||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 | ||||||||
| 9 | ||||||||
| 10 | ||||||||
| 11 |
Tip: The numbers to add come first (D2:D8), then each column to check with its condition. The hand check is 1,200 + 800 + 650.
Practise this in a lesson
Frequently asked questions
Can ChatGPT write Excel formulas?
Yes. AI chatbots can write most everyday Excel formulas if you describe your sheet clearly. The answers are not always right, so test each formula on a few rows you can check by hand before you rely on it.
Why does the formula from ChatGPT not work in my Excel?
The usual causes are cell ranges that don't match your sheet, a function your Excel version doesn't have (which shows #NAME?), or a comma separator where your region uses semicolons. Tell the chatbot your exact layout and version and ask again.
What is the best prompt for an Excel formula?
Give the column letters and what they hold, the first and last data rows, your Excel version, the cell where the answer goes and one example of the correct result. Ask for the formula plus a short explanation of each part.
Is it safe to paste my spreadsheet into ChatGPT?
Only if your company allows it and the data isn't confidential. You rarely need real data: describe the columns and type three or four made-up sample rows instead.
Do I still need to learn Excel formulas if I use AI?
Yes. You need to read a formula to check it, fix it and explain it. Job Excel tests and interviews also expect you to write common formulas yourself, without help.