Free guide
How do you use ChatGPT to write an Excel formula?
Updated 2026-10-18
To get an Excel formula from ChatGPT, give it your column letters, data types, Excel version, and the calculation in plain English. Include a few fictional rows with a total you can check by hand. Ask for one formula and an explanation of which rows count. Test it in a scratch sheet before using it for work.
You don't need to upload the workbook. For a monthly invoice total, the AI needs to know where the dates and amounts are, what "paid" means in your sheet, and where the month begins and ends.
Copy this Excel formula prompt
This example totals paid invoices for one client in March. The rows are fictional. Change the column map and rules to match your task, but keep test rows that should be excluded.
Write one Excel formula for this task, then explain which rows
count and the expected total. Excel Microsoft 365, English
function names, comma argument separators. Headers in row 1,
data in rows 2:8. B = customer, C = invoice date/time (numeric
Excel dates), D = amount (numbers), E = status. Sum amounts for
customer "Client A", status "Paid", in March 2026. Include every
time on 31 March and exclude 1 April. Use bounded ranges and
DATE, not date strings. Do not use macros or change the sheet.
Fictional rows (A = row label):
row 2: INV-A | Client A | 2026-03-01 00:00 | 120 | Paid
row 3: INV-B | Client A | 2026-03-31 16:30 | 80 | Paid
row 4: INV-C | Client A | 2026-04-01 00:00 | 900 | Paid
row 5: INV-D | Client A | 2026-03-15 09:00 | 50 | Pending
row 6: INV-E | Client B | 2026-03-12 00:00 | 70 | Paid
row 7: INV-F | Client A | 2026-02-28 23:59 | 30 | Paid
row 8: INV-G | Client A | 2026-03-20 00:00 | -20 | Paid
If you don't know a data type, ask how to check it before asking for the final formula. A date-looking value can be text: changing its display format alone doesn't prove it is a numeric Excel date. Microsoft explains how Excel stores dates and converts text.
Our test: the answer included the last afternoon of March
On 18 October 2026, we ran the prompt once in Claude Opus 5.5. It returned this formula:
=SUMIFS($D$2:$D$8, $B$2:$B$8, "Client A", $E$2:$E$8, "Paid", $C$2:$C$8, ">="&DATE(2026,3,1), $C$2:$C$8, "<"&DATE(2026,4,1))
Claude selected rows 2, 3 and 8, and gave the expected total of 180: 120 + 80 - 20. That matches the hand calculation. It excluded all four nonmatching rows, including the 900 dated exactly 1 April.
The upper limit matters. Excel stores dates as numbers and times as fractions of a day. Ending the range at midnight on 31 March would miss the 80 paid that afternoon. "Before 1 April" includes the whole last day. The formula uses SUMIFS, which adds values only when all the stated criteria match.
Check it in a scratch sheet
Create a blank sheet with headers A1:E1: Invoice, Customer, Date, Amount, Status. Enter the seven fictional rows above in rows 2:8. For dates, use =DATE(2026,3,1) in C2, =DATE(2026,3,31)+16.5/24 in C3, then DATE formulas for the other rows with their stated dates. The February row only needs =DATE(2026,2,28) to test its exclusion. Enter amounts as numbers, including -20 in D8.
Paste the SUMIFS formula into G2. It should show 180. Change the 80 in D3 to 81: G2 should become 181. Restore 80, then change the April amount in D4 from 900 to 901: the total should stay 180. These checks catch a date limit that drops the last afternoon or includes the next month.
Before using the formula in your working file, extend every range to the same last row. This example stops at row 8, so later invoices will not count until you update the ranges. Check a second month by hand as well, especially if your workbook mixes dates, text, blanks or different status spellings.
If Excel rejects the formula, check your version and separator first. Microsoft documents separator-related errors; this example uses commas. Don't hide an unexplained error with IFERROR just to get a tidy cell.
For a correction, tell the AI the formula, the exact error or wrong result, and the fictional row that should behave differently.
What not to paste
Don't paste payroll, bank details or customer records; use fictional rows instead of uploading your workbook.
The paid AI at Work kit is for someone teaching AI tasks across a team. You can use this example without buying it.
Sources
- Microsoft SUMIFS reference: argument order, multiple criteria, matching range sizes.
- Microsoft DATE reference: numeric dates and conversion from text.
- Microsoft TIME reference: times as fractions of a day.
- Microsoft formula separator troubleshooting.
- Our prompt and full Claude Opus 5.5 answer, 18 October 2026: selected rows and total checked by hand.
Questions people ask
Do I need to upload my spreadsheet?
No. The column letters, data types, calculation rule and a few fictional rows are enough for this example.
Why won't Excel accept the formula?
Check the function names and argument separator your Excel uses. This example uses English names and commas. Tell the AI your Excel version, language, separator and exact error, with a fictional example.
Was the prompt tested in ChatGPT?
The test below used Claude Opus 5.5. You can paste the same prompt into ChatGPT.
Get the 16 prompts, free
The Builder's Prompt Pack: copy-paste prompts to plan, build and launch real things with AI, sent to your inbox.
Get the AI news by email
Once a week, News Desk sends the AI stories that mattered, in plain words, with links to the sources.