ChatGPT for Excel: 25 Prompts That Replace Formulas
I used to keep a browser tab open to a formula reference site at all times. VLOOKUP I knew cold. XLOOKUP I half knew. Anything with a nested IF wrapped around an INDEX MATCH, and I was reverse engineering a Stack Overflow answer from 2014 that almost fit. Using ChatGPT for Excel killed that tab. Now I describe the columns in plain English, and the formula comes back in seconds, usually correct on the first try.
Here is the honest version of what changed. I did not get better at Excel. I got faster at asking. The syntax lives in the model now, and my job is to describe the problem clearly and sanity check the output. That trade is worth it for most people, and I will explain the one place it is not later in this post.
This guide gives you 25 real prompts, grouped by job: writing formulas, cleaning data, analysis and pivots, VBA automation, charts, and debugging. Each one has brackets like [describe your columns] that you fill in. Copy the prompt, paste your specifics, and drop the answer into a cell. No fluff, no theory dumps, just prompts that work.
How ChatGPT actually works with Excel
ChatGPT does not run inside your spreadsheet. It is a text model that reads what you type and writes text back. When you ask it for an Excel formula, it returns the formula as text, and you copy that text into a cell yourself. The spreadsheet does the calculating. ChatGPT does the writing.
The whole workflow is three steps. You describe your data, or paste a small sample of it. You state the result you want in plain words. ChatGPT returns a formula, a macro, or steps, and you paste it into Excel. That loop takes about twenty seconds once you get the rhythm.
Describing your columns matters more than anything else. A prompt like "write a formula" gives you a generic guess. A prompt like "column A has employee names, column B has departments, column C has salaries, I want the average salary for the Sales department" gives you a working SUMIFS or AVERAGEIF on the first shot. The specifics are the whole game, which is the same lesson behind good prompt engineering in any field.
My favorite part is the explanation. Ask ChatGPT to explain the formula it just wrote, line by line, and you learn Excel while you work. I have picked up more about XLOOKUP from asking "why the fourth argument" than from any tutorial. Think of it as a tutor that never gets tired of the same question.
One quotable line for this section: ChatGPT is not a calculator, it is a translator between plain English and Excel syntax.
What ChatGPT cannot do (and how to work around it)
ChatGPT cannot see your file. This is the single most important thing to understand, and most people learn it the hard way. If your workbook is sitting on your desktop, the standard chat has no idea what is in it. It cannot read cell values, sheet names, or your column headers unless you tell it or paste them.
The workaround is simple. Paste a small sample, five to ten rows including the header row, directly into the chat. ChatGPT reads that as text and builds the formula around your real column names. Never paste a thousand rows or anything sensitive like salaries, client names, or medical data. Ten rows of representative structure is enough to write any formula.
Two tools do connect to your actual file. Copilot in Excel, part of Microsoft 365, works inside the ribbon and can act on the live sheet. And ChatGPT with file upload lets you attach a spreadsheet so the model can analyze it directly using its data analysis tool. Both cost money and both have limits, but they close the "it cannot see my file" gap when you need it.
Here is my contrarian take, and Excel purists will not like it. For 90 percent of daily formula work, the free ChatGPT with a pasted sample beats the paid connected tools. The connected tools shine for full file analysis and repeated tasks, but for "write me one XLOOKUP right now," pasting ten rows into a free chat is faster than launching Copilot and waiting for it to index the sheet.
Quotable line: the fastest way to use AI for Excel is not a plugin, it is a clear description and ten pasted rows.
Prompts 1 to 6: Writing and explaining formulas
These cover the lookups and conditional math that eat most of your time. Every prompt names the exact function so ChatGPT does not wander. Fill the brackets with your real column letters and headers.
Prompt 1, VLOOKUP: Write an Excel VLOOKUP formula. My lookup value is in cell [e.g. F2]. The table to search is [describe range, e.g. Sheet2 columns A to D]. I want to return the value from the [e.g. 3rd] column. Use an exact match. Then explain in one sentence what each argument does so I can adjust it later.
Prompt 2, XLOOKUP: Convert this into a modern XLOOKUP formula and tell me why XLOOKUP is safer than VLOOKUP here. Lookup value is in [cell]. The lookup array is [column with the IDs, e.g. A2:A500]. The return array is [column with the result, e.g. D2:D500]. If nothing is found, return the text "Not found" instead of an error.
Prompt 3, INDEX MATCH: Write an INDEX MATCH formula for Excel because my return column sits to the left of my lookup column, so VLOOKUP will not work. The value I am looking up is in [cell]. Match it against [lookup column]. Return the matching value from [return column]. Explain why INDEX MATCH handles a left side return that VLOOKUP cannot.
Prompt 4, SUMIFS: Write an Excel SUMIFS formula. I want to sum [the number column, e.g. sales in column D] where [column B] equals [e.g. "Sales"] and [column C, a date] falls between [start date] and [end date]. Show the formula and note exactly how to format the date criteria so it does not break.
Prompt 5, nested IF: Write a nested IF formula in Excel that assigns a letter grade based on a score in cell [e.g. B2]. The bands are: 90 and above is A, 80 to 89 is B, 70 to 79 is C, 60 to 69 is D, below 60 is F. Then rewrite the same logic using IFS so I can compare which is cleaner.
Prompt 6, COUNTIFS with logic: Write an Excel COUNTIFS formula that counts rows where [column A] contains the text [e.g. "invoice"], [column B] is greater than [e.g. 0], and [column C] is not blank. Explain how to use a wildcard so "contains" works instead of an exact match.
My rule for this whole group: always add "explain each argument in one sentence" to the prompt. It costs nothing and turns a formula you paste blindly into one you can edit next week. If you want a broader stock of reusable requests like these, this pack pairs well with the 50 best ChatGPT prompts I lean on for everyday work.
Quotable line: a VLOOKUP you copied without understanding is a bug waiting for a deadline.
Prompts 7 to 11: Cleaning and transforming data
Messy data is where I spend real time, and it is where ChatGPT earns its keep. Splitting names, fixing dates, standardizing text, removing junk. These prompts turn a two hour cleanup into a ten minute one.
Prompt 7, split a column: I have full names in [column A, e.g. "Priya Sharma"] and I need first name in one column and last name in another. Give me two Excel formulas, one for each. Handle the case where a name has a middle name too, and tell me when I should use Text to Columns or Flash Fill instead of a formula.
Prompt 8, clean and standardize text: My [column B] has messy text with extra spaces, mixed upper and lower case, and stray line breaks. Write an Excel formula using TRIM, CLEAN, and PROPER to normalize it into clean title case. Explain what each of the three functions removes.
Prompt 9, fix inconsistent dates: Column [C] has dates stored as text in mixed formats like "12/01/2026", "1 Dec 2026", and "2026-12-01". Write an Excel formula that converts them all into a real date value Excel can sort and filter. If some cannot convert, show me how to flag them.
Prompt 10, remove duplicates with a key: I have a table in [range, e.g. A1:E2000]. A row is a duplicate when [column A, the email] repeats, even if other columns differ. Write me a helper column formula that marks the first occurrence as "Keep" and the rest as "Duplicate" so I can filter and delete safely without losing the original.
Prompt 11, extract with pattern: Column [D] contains strings like "Order #4821 shipped to Mumbai". I need just the order number and just the city in two separate columns. Write Excel formulas using MID, FIND, or the newer TEXTBEFORE and TEXTAFTER functions, and tell me which version needs Microsoft 365.
I will say something unpopular here. Flash Fill and Power Query beat formulas for a lot of one time cleanups, and a good prompt will tell you that. When I ask ChatGPT to clean data, I add "and tell me if Power Query would be simpler than a formula for this." Half the time it says yes, and it saves me from building a fragile formula chain.
Quotable line: the best data cleaning formula is often the one ChatGPT talks you out of writing.
Prompts 12 to 16: Analysis, pivots, and summaries
Once the data is clean, you want answers. Totals, trends, top performers, month over month change. ChatGPT is strong at both writing the formula and explaining the pivot logic, even though it cannot build the pivot for you.
Prompt 12, pivot table plan: I have a sales table with these columns: [list them, e.g. Date, Region, Product, Rep, Revenue]. I want a pivot table that shows total revenue by region across the rows and by month across the columns. Tell me exactly which field goes into Rows, Columns, Values, and Filters, step by step, as if I have never built a pivot before.
Prompt 13, month over month trend: Write an Excel formula that calculates the percentage change in [the value column, e.g. revenue in column C] from the previous row to the current row, so I can see month over month growth. Format the result as a percentage and handle the case where the previous value is zero without throwing a divide error.
Prompt 14, running total: I have monthly figures in [column B, rows 2 to 13]. Write an Excel formula for a running cumulative total in column C that I can drag down. Then show me the SCAN or SUMIFS alternative and tell me which is more efficient on a large sheet.
Prompt 15, top N with rank: From my table where [column A] is the sales rep and [column B] is total revenue, write an Excel formula that returns the names of the top 5 reps by revenue in order. Use LARGE with INDEX MATCH, and explain how to break a tie when two reps have identical revenue.
Prompt 16, plain English summary: Here is a small sample of my data. [Paste 8 to 10 rows including the header.] In three bullet points, tell me the most important trends you see, the single biggest outlier, and one question I should investigate next. Do not write a formula, just read the numbers.
Prompt 16 is the one people forget ChatGPT can do. Because it reads pasted text, it can act as a quick analyst on a data sample, not just a formula writer. I use it to gut check a dataset before I present it, and it has caught outliers I would have missed. That kind of quiet AI assist is exactly the sort of thing worth building into how you use AI at work without turning it into a whole project.
Quotable line: ChatGPT cannot build your pivot table, but it will tell you exactly which field goes where in about ten seconds.
Prompts 17 to 20: Automation and VBA macros
Automation is where ChatGPT feels closest to magic. VBA is a language most Excel users never learned, and ChatGPT writes it fluently. Repetitive tasks that took an intern an afternoon become a button click. Paste the macro into the Visual Basic editor, run it, done.
Prompt 17, basic macro: Write an Excel VBA macro that loops through every row in [the used range on Sheet1], and if the value in column [E] is greater than [1000], it colors that entire row light green. Add a comment on each line explaining what it does, and tell me exactly where to paste this in the VBA editor and how to run it.
Prompt 18, combine sheets: Write an Excel VBA macro that copies the data from every sheet in the workbook into one master sheet called "Combined", stacking them under a single header row and skipping the header on all sheets after the first. Assume every sheet has the same columns. Include error handling if a sheet is empty.
Prompt 19, auto export to PDF: Write an Excel VBA macro that saves the currently active sheet as a PDF into the same folder as the workbook, named with today's date. Tell me how to attach this macro to a button on the sheet so a non technical colleague can click it.
Prompt 20, bulk find and replace across sheets: Write an Excel VBA macro that finds every instance of the text [old value] and replaces it with [new value] across all sheets in the workbook at once, including inside formulas. Warn me about anything that could go wrong and how to undo it if the replace hits something I did not expect.
A hard warning on VBA, because I learned this the painful way. A macro cannot be undone with Ctrl Z. Once it runs, it runs. I always save a copy of the workbook before running any ChatGPT written macro on real data, and I test it on a duplicate sheet first. ChatGPT writes clean VBA, but it is writing blind, since it cannot see your actual file, so you are the safety net.
Quotable line: ChatGPT writes VBA in seconds, but the undo button does not work on macros, so you save first and test on a copy.
Prompts 21 to 23: Charts and dashboards
ChatGPT cannot draw a chart, but it can tell you exactly which chart to build, how to set it up, and how to write the formulas that feed a dashboard. For layout advice and setup steps, it is genuinely useful.
Prompt 21, choose the right chart: I want to show [what you are visualizing, e.g. monthly revenue across four regions over a year]. My data is laid out as [describe the table]. Tell me which Excel chart type fits best and why, whether a clustered column, a line, or a stacked bar, and give me the exact steps to build it including which cells to select first.
Prompt 22, dynamic dashboard formula: I am building a dashboard where a dropdown in cell [B1] lets the user pick a region. Write an Excel formula using XLOOKUP or SUMIFS that pulls the total revenue for whichever region is selected in that dropdown, so the dashboard number updates automatically when the selection changes.
Prompt 23, KPI cards with conditional formatting: I want a KPI cell that shows this month's revenue in [cell C2] and turns green if it beat last month's revenue in [C1], red if it fell short. Give me the conditional formatting rule step by step, and a formula that also shows the percentage difference next to it.
Here is my opinion on AI and dashboards. ChatGPT is a great co pilot for the formulas and the setup, but it will not design a good looking dashboard for you, because it cannot see the result. Layout, spacing, and color balance still need your eyes. Use it for the plumbing, not the paint.
Quotable line: ChatGPT picks the right chart type in one sentence, but it cannot see whether the result looks good, so design stays your job.
Prompts 24 to 25: Debugging broken formulas
The fastest ROI from ChatGPT for Excel is fixing a formula that broke. You paste the formula and the error, and it tells you the cause and the fix, usually faster than you can spot the missing parenthesis yourself.
Prompt 24, explain and fix an error: This Excel formula is throwing a [e.g. #N/A, #REF!, #VALUE!, or #SPILL!] error: [paste your exact formula]. Tell me in plain English why it is failing, what the error code means, and give me the corrected formula. Also tell me one thing I can add so it fails gracefully next time instead of showing an error.
Prompt 25, simplify a monster formula: Here is a formula someone left me and I do not understand it: [paste the formula]. Break it down step by step in plain English, tell me what it is trying to do, flag anything fragile or risky in it, and rewrite it in a simpler, more readable way if you can without changing the result.
Prompt 25 saved a report I inherited with a formula so nested it wrapped four lines. ChatGPT untangled it, found a hard coded cell reference that should have been relative, and handed back a version half the length. That is the moment I stopped seeing this as a gimmick. If you are still setting up your account, note that you can run every prompt in this post on the free tier, and this walkthrough of how to use ChatGPT for free covers the setup.
Quotable line: paste the broken formula and the error code together, and ChatGPT will usually name the bug before you finish reading it yourself.
Tips to get accurate answers every time
Accuracy in ChatGPT for Excel comes almost entirely from your prompt. The model is capable. The vague question is what fails you. A few habits move the hit rate from "sometimes right" to "right on the first try."
Name your columns and give a sample. "Column A is order date, column B is amount" beats "my sales data" every time. Paste five to ten real rows so ChatGPT builds around your actual headers, not an imagined layout.
State the Excel version. XLOOKUP, TEXTBEFORE, and dynamic arrays need Microsoft 365 or Excel 2021. If you are on Excel 2016, say so, and ask for a formula that works without those functions. This one line prevents most "that function does not exist" replies.
Ask for an explanation and an alternative. "Explain each argument, and give me one alternative approach" turns a single answer into a small lesson and a backup plan. When one formula does not fit your sheet, the alternative usually does.
Verify before you trust. Run the formula on a few rows where you already know the answer. ChatGPT is confident even when it is wrong, so a thirty second spot check on known values is non negotiable. For building prompts that hold up across tasks, my template habits come straight from learning to write a perfect ChatGPT prompt.
Quotable line: the model is rarely the reason the formula is wrong, the vague prompt is.
Mistakes to avoid
Pasting your whole file is the first mistake, and it is both a privacy risk and a waste. ChatGPT does not need a thousand rows. It needs the structure, which ten rows show perfectly. Never paste client names, salaries, or anything confidential into a chat.
Trusting the formula without testing is the second. I have seen a SUMIFS that summed the wrong column because the prompt named columns loosely. The formula looked right and returned a number, just the wrong one. Always test against a value you can verify by hand.
Forgetting to state your Excel version is the third, and it wastes the most time. You get a beautiful XLOOKUP, paste it into Excel 2016, and get a #NAME? error because the function does not exist in your build. Say your version up front.
Running a VBA macro on your only copy is the fourth, and the most dangerous, because macros do not undo. Save a backup, test on a duplicate sheet, then run on the real thing. I treat every AI written macro as untested code until I have watched it work on data I can afford to lose.
Quotable line: the model will hand you a wrong answer with total confidence, so your job shifts from writing formulas to checking them.
Frequently Asked Questions
Can ChatGPT write Excel formulas for free?
Yes. The free tier of ChatGPT writes VLOOKUP, XLOOKUP, INDEX MATCH, SUMIFS, nested IF, and VBA macros with no paywall on formula help. Every one of the 25 prompts in this post runs on the free plan. You only need a paid tier or a connected tool like Copilot in Excel for direct file uploads and large dataset analysis.
How do I use ChatGPT inside Excel directly?
The standard ChatGPT lives in a browser or app, separate from Excel, so you copy formulas across manually. To work inside the ribbon, you need Copilot in Excel, part of a Microsoft 365 subscription, which reads your live sheet. Some third party add ins also bring a chat box into Excel, but the free browser plus paste method covers most needs.
Can ChatGPT read my Excel file?
Not by default. The standard chat cannot open a file on your computer. It only sees data you paste in as text, or files you upload on a paid plan that includes the data analysis tool. For live file access, Copilot in Excel is the Microsoft option built into Microsoft 365.
Is ChatGPT accurate with Excel formulas?
It is accurate most of the time when your prompt names the columns and states the goal clearly. The common failures come from vague prompts or an unstated Excel version, not the model itself. Always test the formula on a few rows where you already know the correct answer before trusting it on the full sheet.
Does ChatGPT work with Google Sheets?
Yes. Add "for Google Sheets" to any prompt in this post and you get the Sheets version. Most functions are identical, and ChatGPT knows the Sheets specific ones like ARRAYFORMULA, QUERY, and IMPORTRANGE that Excel does not have.
What is the best prompt to fix a broken Excel formula?
Paste the exact formula and the exact error code together, then ask ChatGPT to explain why it failed and return a corrected version. Error codes like #N/A, #REF!, and #SPILL! each point to a specific cause, and giving ChatGPT both the formula and the code lets it name the bug fast, often in one reply.
Can ChatGPT write VBA macros?
Yes, and it is one of its strongest Excel skills. Describe the repetitive task in plain English, and ChatGPT returns commented VBA you paste into the Visual Basic editor. Always save a backup first, because macros cannot be undone with Ctrl Z once they run.
Do these prompts work in Excel 2016?
Most do, but functions like XLOOKUP, TEXTBEFORE, and dynamic arrays need Microsoft 365 or Excel 2021. Add "I am on Excel 2016, avoid functions my version does not support" to any prompt, and ChatGPT will fall back to INDEX MATCH and older syntax that works in your build.
Recommended Blogs
50 Best ChatGPT Prompts to Save Time in 2026
How to Write ChatGPT Prompt Templates
How to Use ChatGPT for Free (Beginner Guide)
Unrot teaches skills like this in 5 minutes a day. If you want short, practical AI lessons that stick, try it at unrot.co.





