Templates, guides & honest tool reviews for small business

Sunday, November 29, 2026

Claude for Excel Formulas: Prompts That Work and Checks to Run

Claude for Excel formulas: prompts and checks
Illustration: Claude for Excel formulas

You can use Claude for Excel formulas by describing your sheet in a chat and asking it to write the formula. This guide covers the plain chat method: you copy a few made-up or non-sensitive rows into the conversation, ask for a formula, paste the answer into Excel and test it. It does not cover any add-in or built-in integration, because features change, so check Anthropic's own pages if you want those. The prompts below also work with other chat assistants.

What to tell Claude first

A good answer needs context. Give these four things:

  1. Your Excel version, such as Excel 365 or Excel 2016, because functions like XLOOKUP and FILTER are missing in older versions.
  2. Where the data is, with column letters and the first data row, for example "names in A2:A100, sales in C2:C100".
  3. What you want, in plain words, with one example of the result.
  4. Edge cases, such as blanks, text numbers or duplicates.
What to tell Claude before asking for an Excel formula
Version, ranges, goal, edge cases (illustration).

A prompt you can copy

"I use Excel 365. Column A has customer names (A2:A100), column B has regions and column C has sales. I want the total sales for the region typed in F1. Give me one formula for cell G1 and explain each part in one sentence."

A good reply is a SUMIF such as =SUMIF(B2:B100, F1, C2:C100). Compare it with our SUMIF guide to see if the logic matches what you asked.

Example prompt asking Claude for an Excel SUMIF formula
Made-up ranges (illustration).

Prompt for a lookup

"Excel 365. Table in A1:D100 with headers. I want the price in column D for the product typed in G2, matched in column B. If the product is not found, show the text Not found. Use XLOOKUP and also give a version for Excel 2016."

Asking for two versions is useful. The background is in XLOOKUP vs VLOOKUP.

Prompt to explain a formula you inherited

"Explain this Excel formula step by step, as if I am new to Excel, and tell me what could go wrong: =IFERROR(INDEX(C2:C100, MATCH(F1, A2:A100, 0)), "")". This works well for old workbooks. Remove any private names or numbers from the formula before you paste it.

Prompt to fix an error

Paste the formula, the error text, and two or three sample rows of made-up data. Ask: "What causes this error, and what is the smallest change that fixes it?" Our guide on fixing Excel formula errors with an AI chat has more examples, and the same checks apply here.

Prompt to clean messy text

"Column A has names in mixed case with extra spaces, such as ' aNN lee '. Give me a formula for B2 that trims the spaces and makes each word start with a capital letter." The usual answer uses TRIM and PROPER. If it also mentions hidden characters, see removing extra spaces in Excel.

Check every answer before you trust it

An AI assistant can write a formula that looks right and is wrong. Always:

  • Test it on three rows where you already know the answer.
  • Test an empty cell, a duplicate and an unusual value.
  • Check that every function exists in your Excel version.
  • Look at the ranges. Wrong ranges are the most common mistake.
Checks before trusting an AI written Excel formula
Test on rows you know (illustration).

Keep private data out of the chat

Do not paste customer details, salaries, passwords or anything your employer treats as confidential. Use invented rows that have the same shape as your data. Check your company policy and the privacy settings of the tool before you use real files.

Keep private data out of AI prompts for Excel
Use invented rows (illustration).

When a formula is not the right answer

If the job is repeated every week, a pivot table, Power Query or a macro may be better than a long formula. Ask the assistant for options and their trade-offs, then pick one you can maintain.

Questions and answers

Can Claude open my Excel file?

That depends on the tool and plan you use, and it can change. In a plain chat, the simple and safe route is to paste a few sample rows.

Which is better for formulas, Claude or ChatGPT?

Both can write and explain formulas. Results depend on the prompt and the task, so try the same prompt in each and test the output. For ChatGPT prompts, see our ChatGPT Excel formula prompts.

Why does the formula use a function I do not have?

You did not state your Excel version. Add it to the prompt and ask for a version that works there.

Does this work for Google Sheets?

Yes. Say "Google Sheets" in the prompt, because some functions differ, for example ARRAYFORMULA and QUERY exist only there.

العربية