AI Tools › Guides › Excel formulas with ChatGPT
How to Use ChatGPT to Write Excel Formulas
ChatGPT can suggest a formula from a description of your spreadsheet.
In short
The quality of the answer depends on how precise your description is, and you must always test the result.
- Describe the structure of the sheet
- Say what you want to get
- State your Excel version
- Ask for the formula, then an explanation
- Test on 2 or 3 rows
Many people lose time because they know what they want from Excel (“add up one customer's sales for a given month”) but not how to write it. An AI is useful here: it turns a sentence into a formula, then explains each piece. It can't see your file unless you give it, so everything depends on the quality of your description.
How to do it
- Describe the structure of the sheet: which columns (letter and heading), which row the data starts on, what kind of content (dates, amounts, text).
- Say what you want to get, with a numeric example taken from your data.
- State your Excel version and language. Some recent functions are not available everywhere: according to Microsoft's page, XLOOKUP is not available in Excel 2016 and Excel 2019.
- Ask for the formula, then an explanation of each argument in one sentence.
- Test on 2 or 3 rows whose right answer you know, then extend to the whole sheet.
Two formulas to know
Here are two functions whose syntax was taken from Microsoft's support site. They serve as a reference for checking what ChatGPT suggests.
| Function | Official syntax | What it does |
|---|---|---|
| XLOOKUP | XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]) | Find in a table the item that matches a value (for example the price of a product code). |
| SUMIFS | SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) | Add the values that meet several conditions at once. |
In XLOOKUP, the optional if_not_found argument lets you show text of your choice instead of the #N/A error when nothing matches. In SUMIFS, the range to add comes first.
Separator: depending on your language and regional settings, Excel expects either commas or semicolons between arguments. If a formula is rejected, try the other separator.
A complete prompt to copy
You are an Excel expert who explains things simply. My data is in the sheet "Sales". Headings are in row 1, data starts in row 2. Column A: sale date. Column B: customer name. Column C: product. Column D: amount in dollars. In another sheet, "Customers", column A contains the customer name and column C contains their email address. I want, in the "Sales" sheet, a column E that shows the email address of the customer on each row, and the text "unknown customer" if the name is not in the "Customers" sheet. I use Excel for Microsoft 365 in English. Give me the formula to type in E2, explain each argument in one sentence, then tell me how to copy it down to the last row. Finish with two common errors that might appear and how to fix them.
A second example: calculate with several conditions
In the "Sales" sheet (headings in row 1, data from row 2 to row 500), column B contains the customer, column C the product, column D the amount. I want the total of the amounts for the customer written in cell G1 AND for the product written in cell G2. Write the formula for English-language Excel, explain it, and suggest a variant that counts the number of sales instead of adding them up. If my request is ambiguous, ask me your questions first.
When you have a file rather than a description
According to OpenAI's help page consulted on Nov 23, 2026, ChatGPT accepts spreadsheets (XLSX, XLS, CSV, TSV, ODS), with a limit of about 50 MB depending on row size, and free accounts are limited to 3 file uploads per day. Limits can change: check the help page. Before uploading a file, remove personal and confidential data (customer names, addresses, salaries, internal figures) or replace them with fictional examples. A description of the columns with three made-up rows is often enough to get a good formula.
Mistakes to avoid
- A vague description (“make me a formula for my sales”) gives a generic formula that doesn't match your columns.
- Copying without testing: a formula that returns no error can still give a wrong number. Check it on rows whose result you know.
- Forgetting the Excel version: a recent function may not exist for your colleague or in your version.
- Pasting sensitive data without thinking. See also our guide on ChatGPT and personal data.
Going further
To structure your requests, use our prompt generator. If your text contains strange characters after a copy and paste, try the ChatGPT text cleaner. Everyday admin tasks are also covered in our prompts for administrative assistants.
Frequently asked questions
Can ChatGPT read my Excel file?
According to OpenAI's help page, it accepts XLSX, XLS, CSV, TSV and ODS formats, with size and upload limits that depend on your plan. Don't send it confidential data.
Why doesn't the suggested formula work?
Common causes: a poorly described column, a function missing from your Excel version, or the wrong argument separator (comma or semicolon). Paste the exact error message into the conversation.
Is XLOOKUP available in every version of Excel?
No. Microsoft's help page says it is not available in Excel 2016 and Excel 2019. Check in your version.
Should I trust the result?
No, check it. Test the formula on a few rows whose answer you know before extending it to the whole sheet.
Sources: Microsoft: XLOOKUP function · Microsoft: SUMIFS function · OpenAI Help Center: file uploads FAQ. Guide updated on November 23, 2026.
Free tools to go faster
- Prompt generatorFill in a few fields, or pick a template if you like: your prompt builds itself as you type, ready to copy.
- ChatGPT text cleanerNo more ** and ### in your documents: paste the text and get a clean version, or formatting ready for Word.
Ready-to-copy prompts
On the same topic
- How to Write a Professional Email With ChatGPT
- How to Make a PowerPoint Presentation With ChatGPT
- Summarize a PDF, Word File or Text With ChatGPT
- How to Prepare a Business Plan With ChatGPT
- How to Proofread Grammar and Style With ChatGPT