ONLINEAGENT_OPS 2026.Q3 HOME HUBSMODELSBUILDINGCOMPANIESFILMMAKINGSECURITYLIVING WITH ITSKILLSALL HUBS, ONE TERMINAL → ARTICLES CRAFT RECORD BLOG TOOLS SKILLS SEARCH /
HOME›ARTICLES›HOW TO WRITE EXCEL FORMULAS WITH AI
ARTICLES · HOW-TOBEGINNER

How to Write Excel Formulas With AI

Write Excel and Google Sheets formulas with AI: describe the goal and the layout, ask for an explanation, test on a copy and check three rows by hand.

READ7 min
WORDS1,449
SECTIONS8
TYPEHOW-TO
CHECKED5 OCT 26

You can write Excel or Google Sheets formulas with AI in about five steps: describe what you want in plain words, say which columns hold what, ask for the formula and an explanation, test it on a copy, then check a few results by hand.

Ask for a line-by-line explanation, and test the formula on a copy of your file. AI is very good at turning “add up the sales for the North region in March” into a working formula. It can also give you one that runs without an error and is still wrong.

TL;DR — THE SHORT VERSION
  • Describe the goal, not the formula. Say what goes in, what should come out, and where the data sits (column letters, the first row of data).
  • Say which program you use: Excel or Google Sheets, and which version if you know it.
  • Ask it to explain the formula in plain words, so you can spot a wrong column or a wrong condition.
  • Test on a copy, then check three rows by hand. A formula without an error message can still give the wrong answer.
  • Both programs have AI built in for some accounts: Copilot in Excel and Gemini in Google Sheets.

What you need

The plain point: a clear goal, the layout of your sheet, and a few example rows with the answer you expect.

  • The goal in one sentence: “For each order, show ‘Late’ if it arrived after the due date.”
  • The layout: which column holds what, which row the headers are in, where the answer should go.
  • Two or three example rows, with made-up numbers if the real ones are private, and the answer you would expect for each.
  • A copy of your file to test on.
  • A chatbot, or the AI button in Excel or Sheets if your account has one.

A quick word on terms. A formula is the calculation you type into a cell, starting with “=”. A range is a block of cells, such as A2:A100. A function is a named calculation inside a formula, such as SUMIFS, which Microsoft describes as adding up the values that meet several conditions.1

The steps

The plain point: describe it, get it explained, test it on a copy, check it by hand.

  1. Describe the goal and the layout. Use the starter prompt below.
  2. Ask for the formula plus an explanation of each part. If the explanation mentions the wrong column, the formula is wrong.
  3. Paste it into a copy of your file, in one cell first.
  4. Check that cell by hand. Work out the answer for that row yourself, with a calculator if needed. Do the same for two more rows, including an awkward one: a blank cell, a zero, a date at the end of the month.
  5. Fill it down only when those checks pass. Then check the last row too.
  6. If it breaks, paste the error back. Give the exact formula and the exact error, such as #NAME? or #N/A, and ask what went wrong.
TAKEAWAY

No error message does not mean the right answer. The hand check on three rows is the step that catches the expensive mistakes.

If your spreadsheet has an AI button

The plain point: Excel and Google Sheets can both write formulas inside the sheet, for some accounts. The same checking rules apply.

In Excel: select the Copilot icon in the lower-right corner. Microsoft says Copilot can generate formulas and apply them across sheets, but only some Microsoft 365 subscriptions include it.2

In Google Sheets: click Ask Gemini at the top right, describe the formula, then click the cell and Insert. If a cell shows an error, hover over it and click Fix. This needs an eligible Google Workspace or Google AI plan.3

No button? A separate chatbot works just as well: describe the sheet there, then paste the formula into your copy.

Starter prompts

The plain point: the program, the layout, the goal, an example, and a request to explain.

WRITE A FORMULA — ADAPT THE BRACKETS
I use [Excel for Microsoft 365 / Google Sheets]. My sheet: headers in row 1, data from row 2 to row [500]. Column A: [order date]. Column B: [region, e.g. North, South]. Column C: [sales amount]. I want a formula in [cell F2] that [adds up the sales for the region typed in E2, only for orders in March 2026]. Example: if E2 says North, the answer should include rows like [A5 = 3 March 2026, B5 = North, C5 = 120] but not [A6 = 2 April 2026, B6 = North]. Give me the formula, then explain each part in plain English. Tell me what will happen with blank cells or text in column C.
EXPLAIN OR FIX A FORMULA
This formula is in [cell D2] of [Google Sheets]: [paste the formula exactly] It shows [#N/A / a number I think is wrong: 0 instead of about 400]. What it should do: [find the price for the product code in A2 from the table on the Prices sheet]. Explain what the formula does now, step by step, then give me a corrected version and say what you changed.

What AI gets wrong with formulas

The plain point: the wrong cells, the wrong function, or the wrong rule. All of these can look perfectly fine.

  • Wrong range. It assumes your data starts in row 1 or stops at row 100, so new rows are left out.
  • References that move when copied. Microsoft explains that a normal cell reference shifts when you copy a formula, and a $ sign fixes it in place. AI sometimes leaves out a $ that was needed.4
  • A misspelt or unknown function name. Excel then shows #NAME?, and Microsoft says the most common cause is a mistyped function name.5 Telling the AI your program and version helps.
  • The wrong rule. “After the due date” becomes “on or after”. Only the hand check on an edge case catches this.
  • Confident explanations. Microsoft’s own help for Copilot in Excel warns that its formulas can be wrong.6 Google says Gemini in Sheets “may suggest inaccurate or inappropriate information.”3
◈ IN PLAIN TERMS

A spreadsheet does exactly what the formula says, not what you meant. The AI writes what it thinks you meant. Your hand check is where the two meet.

Keep private data out of the chat

The plain point: the AI needs the layout, not the real names and numbers.

Describe the columns and use made-up example rows. Salaries, customer lists and medical data should not go into a personal chatbot account. Google, for example, says some Gemini chats are read by human reviewers.7 At work, use only the tools your employer allows; using AI at work covers the rules.

Questions people ask

Can ChatGPT write Excel formulas?

Yes, chatbots such as ChatGPT can write and explain formulas from a plain description. Test each one on a copy and check a few rows by hand: Microsoft warns that even the formulas from its own Copilot can be inaccurate.6

Does Excel have AI built in?

Copilot in Excel can create formulas, but only some Microsoft 365 subscriptions include it. Google Sheets has a similar Gemini panel on eligible plans.2

Why does the formula from AI show #NAME?

Microsoft says the top reason is a typo in the function name. Paste the exact formula and error back to the AI, and tell it which program and version you use.5

Is it safe to paste my spreadsheet into AI?

Not if it holds private or work data and you are on a personal account. Describe the layout with made-up rows instead; the formula works the same. Google, for one, says people may review some Gemini chats.7

Where to go next

SOURCES
  1. 1Microsoft Support, SUMIFS function, undated, read at source 5 Oct 2026“The SUMIFS function, one of the math and trig functions, adds all of its arguments that meet multiple criteria.” ↑
  2. 2Microsoft Support, Get started with Copilot in Excel, undated, read at source 5 Oct 2026“Select the Copilot icon in the lower-right corner of Excel.” and “Generate data and formulas: Generate data based on your prompts, perform calculations and apply formulas across multiple sheets, and summarize data.” Also: “If you don’t see Copilot in Word, Excel, PowerPoint, or OneNote, it might not be included with your Microsoft 365 subscription or available based on your organization’s settings.” ↑a“it might not be included with your Microsoft 365 subscription or available based on your organization’s settings.” ↑b
  3. 3Google, Docs Editors Help, Collaborate with Gemini in Google Sheets, undated, read at source 5 Oct 2026“At the top right, click Ask Gemini”; “To add the formula to your spreadsheet, click the cell you’d like to insert this formula, click Insert”; for errors, “Hover over the cell. Click Fix”; “This feature requires an eligible Google Workspace or Google AI plan.” ↑a“Gemini features may suggest inaccurate or inappropriate information.” ↑b
  4. 4Microsoft Support, Switch between relative, absolute, and mixed references, undated, read at source 5 Oct 2026“When you copy a formula that contains a relative cell reference, that reference in the formula will change.” ↑
  5. 5Microsoft Support, How to correct a #NAME? error, undated, read at source 5 Oct 2026“The top reason why the #NAME? error appears in the formula is because there’s a typo in the formula name.” ↑a“The top reason why the #NAME? error appears in the formula is because there’s a typo in the formula name.” ↑b
  6. 6Microsoft Support, Frequently asked questions about Copilot in Excel, undated, read at source 5 Oct 2026“Copilot generates insights and formulas and explains them in fluent, grammatically correct language, but the content can be inaccurate or inappropriate. Review, edit, and verify anything Copilot creates before you rely on it.” ↑a“Copilot generates insights and formulas and explains them in fluent, grammatically correct language, but the content can be inaccurate or inappropriate.” ↑b
  7. 7Google, Gemini Apps Privacy Hub, last updated 24 Sep 2026, read at source 5 Oct 2026“Please don’t enter confidential information that you wouldn’t want a reviewer to see or Google to use to improve our services, including machine-learning technologies.” ↑a“Please don’t enter confidential information that you wouldn’t want a reviewer to see or Google to use to improve our services, including machine-learning technologies.” ↑b

The explanations of formula, range and the hand check, and the starter prompts, are this site’s own, not claims from these sources.

Free printable AI cheat sheets, and AI news every week.

Sixteen one-page AI guides and checklists in one free PDF, no sign-up. And if you want to keep up, the newsletter covers what changed in AI each week, in plain English, with the sources.

SUBSCRIBE FREE ↗ GET THE CHEAT SHEET PACK
aipromptgeneer://$ about this siteAI PROMPT GENEERAI explained in plain English. Every claim links to its source, with the date it was checked.NEWSLETTERWhat changed in AI each week, in plain English.SUBSCRIBE FREE ↗AI PROMPT GENEER · MACHINE ASSISTANCE DISCLOSEDEVERY ARTICLE CARRIES ITS OWN CHECKED DATE