How to Use ChatGPT to Write Excel Formulas: Prompts and a 5-Step Check

You can use ChatGPT to write Excel formulas in about a minute. Describe the task, copy the formula, paste it into a cell. The catch is that ChatGPT cannot see your sheet unless you show it, so it fills the gaps with guesses: a range like A1:A10, a column you never mentioned, a date rule that skips the last day of the month. The formula still looks right. This guide shows what to put in the prompt, and how to check the answer against a number you already know.

The difference between a vague and a specific ChatGPT prompt for an Excel formula
A specific prompt tells ChatGPT the Excel version, columns, rows and exact condition.

The four things every formula prompt needs

Most bad formulas come from missing details, not from ChatGPT being bad at Excel. Give it these four and the first answer is usually usable.

IncludeExampleWhy it matters
Your Excel versionMicrosoft 365, Excel 2019, Google SheetsXLOOKUP and FILTER do not exist in Excel 2016 or 2019
The layoutHeaders in row 1, data in rows 2 to 7, column D is SalesStops it from inventing ranges
The exact goalSum D where B is “East” and C falls in January 2026“Total East sales” can mean five different things
What you want backOne formula for cell G2, plus a one-line explanationSaves you from three alternatives and a lecture

The fastest way to describe the layout is to paste five or six rows of the sheet. Swap real names, customers and amounts for made-up ones first. ChatGPT only needs the shape of the data.

광고

A worked example you can copy

Here is a small sales sheet. Type it into a blank workbook if you want to follow along. Column C holds dates, and one of them came from a system export, so it carries a time.

RowA: RepB: RegionC: Order dateD: Sales ($)
2AnaEast1/5/20261,200
3BenWest1/12/2026950
4CaraEast1/20/20261,500
5DevEast2/3/2026800
6EliWest2/14/20261,100
7FayEast1/31/2026 3:20 PM600

The prompt:

I use Excel for Microsoft 365. Headers are in row 1 and data is in rows 2 to 7. Column A is Rep, B is Region, C is Order date (some dates include a time), D is Sales in dollars. Write one formula for cell G2 that adds up Sales where Region is "East" and the order date is in January 2026. Explain in one sentence how it works.

Before you send it, work out the answer yourself. East orders in January are Ana, Cara and Fay: 1,200 + 1,500 + 600 = 3,300. Dev is East but his order is in February, so he stays out. That number is your test.

A good answer looks like this:

=SUMIFS(D2:D7, B2:B7, "East", C2:C7, ">="&DATE(2026,1,1), C2:C7, "<"&DATE(2026,2,1))

It returns 3,300. SUMIFS takes the range to add first, then pairs of “range to test” and “condition”. The date test uses “before February 1” instead of “on or before January 31”, and that choice matters, as the next section shows.

Five steps to use ChatGPT to write Excel formulas and test them
How to use ChatGPT to write Excel formulas: describe, set the goal, work out the answer, compare, report both numbers.

Wrong formulas that look right

These are the mistakes worth watching for. Every result below is worked out by hand from the sample table, so you can reproduce each one.

Formula you might getResultWhat went wrong
=SUMIFS(D2:D7, B2:B7, "East", C2:C7, ">="&DATE(2026,1,1), C2:C7, "<="&DATE(2026,1,31))2,700Fay’s order at 3:20 PM on January 31 is later than midnight on January 31, so it drops out
=SUMIFS(D2:D7, C2:C7, ">="&DATE(2026,1,1), C2:C7, "<"&DATE(2026,2,1))4,250The region condition is missing, so Ben’s West sale is counted
=SUMIF(D2:D7, "East", B2:B7)0SUMIF puts the range to add last, SUMIFS puts it first. Here it searches the sales column for “East” and finds nothing
=SUMIFS(D2:D7, B2:B6, "East")#VALUE!The ranges are different sizes. Every range in SUMIFS must cover the same rows
=COUNTIFS(B2:B7, "East")4It counts orders instead of adding sales

The first one is the sneakiest. It works on clean dates and fails only when a time is hiding in the cell, which is common in data exported from a CRM or an online store. A zero is the most dangerous result, because it looks like a real answer. Microsoft’s SUMIFS page lists a 0 as a common problem, usually a text condition without quotation marks, and warns that SUMIF and SUMIFS take their arguments in a different order.

Sample sales rows and the result of each ChatGPT SUMIFS formula
Worked by hand: only the formula that stops before February 1 returns the expected 3,300.
광고

How to ask for a fix

“That’s wrong” gets you a reworded version of the same formula. Give ChatGPT the number you got, the number you expected, and your guess about the cause:

Your formula returns 2,700 but the answer should be 3,300. Fay's row (January 31, 3:20 PM, 600) is missing. I think the date condition stops at midnight on January 31. Fix only the date condition.

For error codes, paste the exact formula and the exact message. #NAME? usually means Excel does not recognize a function, either because of a typo or because your version does not have it. Say which version you use and ask for an alternative, for example INDEX and MATCH instead of XLOOKUP in Excel 2019. #VALUE! in SUMIFS or COUNTIFS usually points to ranges of different sizes. #SPILL! means a formula that returns several cells is blocked by something already in the way.

More prompts that work

Same pattern each time: version, layout, exact goal, what to return. The expected results use the sample table above.

TaskPrompt detail that mattersTypical formulaCheck with
Look up a value“If the name is not found, show Not found”=XLOOKUP(G2, A2:A7, D2:D7, "Not found")Dev gives 800, Gus gives Not found
Label rows“Hit if sales are 1,000 or more”=IF(D2>=1000, "Hit", "Miss")Dev (800) is Miss. Test a row with exactly 1,000
Count by condition“Count orders, not sales”=COUNTIFS(B2:B7, "West")2
Fix an errorPaste the formula and the error textDepends on the causeThe fixed version on known rows

Ask for an explanation every time. If you cannot follow it, you will not be able to fix the formula when your sheet changes next month.

ChatGPT chat, ChatGPT for Excel or Copilot?

There are now three common ways to get a formula from AI, and they differ in what they can see.

ChatGPT chat, ChatGPT for Excel add-in and Copilot in Excel compared
ChatGPT chat, the ChatGPT for Excel add-in and Copilot in Excel differ in what they can see and change.
  • ChatGPT in the browser or app only knows what you type or upload. It works with any spreadsheet program, which is why the four-part prompt matters so much here.
  • ChatGPT for Excel is an add-in that opens in a sidebar. In Excel, go to Home, then Add-ins, search for ChatGPT, add it and sign in. OpenAI’s help page lists Free, Go, Plus, Pro and business plans, with limited use on Free and Go. It can read and change the workbook, so OpenAI suggests duplicating important files first and reviewing every changed cell. VBA and macros may not be fully supported, and its chats do not appear in your normal ChatGPT history.
  • Copilot in Excel is Microsoft’s built-in assistant. Microsoft lists Excel for Microsoft 365 (Windows and Mac), Excel 2024, Excel for iPad and Excel for the web. It can suggest formula columns and explain a selected formula. Access depends on your Microsoft 365 plan.

Watch what you share: anything you paste into a chat or let an add-in read leaves your computer. OpenAI’s help page for the add-in says some logs may be kept for 30 days, and that Microsoft may be able to read workbook content under its add-in marketplace terms. Use made-up rows when you are only asking for a formula, and follow your company’s rules for customer and payroll data.

Five checks before you trust the formula

Run these on a copy of the file. They take two or three minutes and catch nearly every mistake in the table above.

  1. Known answer. Work out the result by hand on five or six rows and compare.
  2. Same-sized ranges. Click into the formula. Every range should start and end on the same rows, and reach the last row of your data.
  3. Edge cases. Add a row exactly on the limit (1,000, the last day of the month), a blank cell and a value that should not match.
  4. Your version. If a function name stays as #NAME?, your Excel does not have it.
  5. Fill down. Copy the formula to the next rows and check that fixed cells have dollar signs (like $G$1) and moving ones do not.

If the formula passes your hand-worked total and the edge cases, it is safe to use on the full sheet. If you want to understand the lookups ChatGPT suggests most often, read how to use XLOOKUP and how to use VLOOKUP.

Checklist before using a ChatGPT Excel formula on real data
Five checks before you trust a formula from ChatGPT.

Frequently asked questions

Can I use free ChatGPT to write Excel formulas?

Yes. Writing and explaining formulas works on the Free plan in the normal chat. The ChatGPT for Excel add-in is also open to Free users, with limited use, according to OpenAI as of November 2026.

Why does ChatGPT’s formula return #NAME?

Excel does not recognize a function in it. Either the name is misspelled or your version lacks it, such as XLOOKUP in Excel 2019. Tell ChatGPT your version and ask for a formula that works there.

Is it safe to paste my spreadsheet into ChatGPT?

For a formula, ChatGPT only needs the column layout and a few sample rows. Replace names, customers and amounts with made-up values, and check your company’s policy before sharing work data.

Does this work for Google Sheets?

Yes. Say “Google Sheets” in the prompt. SUMIFS, COUNTIFS, IF and XLOOKUP work the same way there, but some functions differ, so name the app every time.

Should I use ChatGPT or Copilot in Excel?

If your plan includes Copilot or you install the ChatGPT for Excel add-in, the assistant can read the sheet directly, which saves describing it. Plain ChatGPT works with any version. Whichever you use, check the result against a number you worked out yourself.

Sources: Last checked November 5, 2026. OpenAI Help Center: ChatGPT for Excel and Google Sheets. Microsoft Support: SUMIFS function and Generate formulas with Copilot in Excel. The example results were worked out by hand from the sample table. Plans and menus change over time.

광고

#ChatGPT  #ExcelFormulas  #ChatGPTForExcel  #SUMIFS  #ExcelTips  #AIAtWork  #ChatGPTPrompts  #CopilotInExcel  #Spreadsheets  #MetaTrend

Found this useful? Share it.