Knowing how to use ChatGPT with Excel can save time when you are building formulas, cleaning test data, or exploring a spreadsheet you did not create. Instead of searching through documentation for every function, you can describe the task in plain English and ask for a specific solution.
This guide uses a small fictional sales dataset and walks through 15 practical examples. You will copy prompts, apply the suggested steps in Excel, and check results against known values. The same approach works for QA reports, bug exports, and other technical datasets.
How ChatGPT Works with Excel
In the basic workflow, ChatGPT and Excel are separate tools. You describe your spreadsheet and goal in ChatGPT, copy the suggested formula or instructions, and then apply and test them in Excel. ChatGPT does not automatically see or change your workbook just because you ask a question.
Some ChatGPT plans or configurations may offer file uploads or other integrations, but their availability and behavior vary. The examples below do not require them: you can work entirely with text prompts and manually enter results.
What You Need Before You Start
You need access to Excel, access to ChatGPT, and a disposable workbook for practice. Excel for Microsoft 365 is suitable for all examples, although most also work in older versions. If a response uses an unavailable function, tell ChatGPT your Excel version and request an alternative.
ChatGPT vs. Microsoft Copilot in Excel
Microsoft Copilot in Excel is a separate Microsoft product that can offer AI assistance within Microsoft’s ecosystem. Its availability, features, and licensing requirements depend on your Microsoft account and subscription. Do not assume a ChatGPT subscription includes Copilot or that either product has access to a particular workbook without the relevant permissions and setup.
Prepare a Sample Spreadsheet and Write Better Prompts
Start with a predictable dataset so you can tell whether an AI-generated answer is correct. The names and email addresses below are fictional. Enter the dates as actual Excel dates, not text, and format the Unit Price column as currency if you prefer.
Create a Small Sales Dataset
Paste the following tab-separated block into cell A1 of a blank worksheet. If Excel does not split it automatically, use Data > Text to Columns and select Tab as the delimiter. Check that the dates are recognized correctly for your locale.
Date Product Region Units Unit Price Customer Email
2025-01-01 Mouse North 2 25 alice.smith@example.com
2025-02-01 Keyboard South 3 40 bob.jones@example.com
2025-03-01 Mouse North 4 25 alice.smith@example.com
2025-04-01 Keyboard North 1 40 cara.lee@example.com
Add Total Sales in G1. Column G will be calculated in the first example and reused throughout. The expected row totals are 50, 120, 100, and 40, for a grand total of 310.
Use a Reusable Excel Prompt
Useful prompts describe the workbook rather than assuming the model can see it. Include the version, column letters, relevant row range, desired output, and a few representative values. For example:
I use Excel for Microsoft 365. My data is in A1:G5: A Date, B Product, C Region, D Units, E Unit Price, F Customer Email, and G Total Sales. Row 2 has Mouse, North, 2 units at 25; row 3 has Keyboard, South, 3 units at 40. Give me a formula for [goal], where to enter it, and the expected result.
The formulas below use commas as argument separators. Depending on your Excel locale, you may need semicolons instead. Regional settings can also affect date parsing and decimal separators, so include your locale in the prompt if an answer fails.
15 Practical Ways to Use ChatGPT with Excel
Each example assumes you have completed the sample setup. Copy the prompt into ChatGPT, compare its answer with the suggested approach, and perform the numbered actions in Excel. For independent experiments, use empty cells or a separate worksheet.
Generated formulas are starting points, not verified requirements. In particular, check whether a formula should be copied down, whether ranges include headers, and whether your task requires exact or approximate matching.
1. Calculate Total Sales with a Formula
Goal: Multiply units by unit price for each order. Prompt: “In Excel, D2 is 2 units and E2 is 25 per unit. Give me a formula for total sales in G2 and explain how to apply it through row 5.”
- Enter
=D2*E2 in G2. - Drag the fill handle down to G5.
Check: G2 is 50 and G3 is 120. The sum of G2:G5 is 310. Relative references should change as the formula is copied.
2. Fix an Excel Formula Error
Goal: Diagnose a broken sales calculation. Prompt: “My formula =D2*E6 gives zero, but D2 contains 2 and E2 contains 25. E6 is blank. Explain the problem and correct it.”
- Inspect the formula bar and compare the referenced cells with the intended row.
- Replace the formula with
=D2*E2 and confirm that it returns 50.
Check: This is a logic error, not necessarily an Excel error message. A plausible-looking zero can still be wrong, so verify the underlying references.
3. Sum Sales by Region with SUMIF
Goal: Total sales for the North region. Prompt: “Regions are in C2:C5 and sales are in G2:G5. Give me a SUMIF formula for North and its expected result for sales 50, 120, 100, and 40.”
- In an empty cell, enter
=SUMIF(C2:C5,"North",G2:G5). - Compare the result with the three North rows.
Check: The result is 190. If your source has inconsistent region labels, clean them before relying on the total.
4. Count Orders Matching Multiple Conditions with COUNTIFS
Goal: Count North orders for Mouse. Prompt: “Product is in B2:B5 and region is in C2:C5. Count rows where product is Mouse and region is North using COUNTIFS.”
- Enter
=COUNTIFS(B2:B5,"Mouse",C2:C5,"North") in an empty cell. - Inspect rows 2 through 5 to verify both conditions.
Check: The result is 2. This counts orders, not units; use a sum-based formula if you need the number of units sold.
5. Look Up a Product Price with XLOOKUP
Goal: Find the price of Mouse. Prompt: “Products are in B2:B5 and prices in E2:E5. Find the price for Mouse using XLOOKUP, and suggest an older Excel alternative.”
- Enter
=XLOOKUP("Mouse",B2:B5,E2:E5,"Not found"). - Check that the result is 25.
Check: XLOOKUP returns the first matching price; repeated products with different prices need a clearer rule. XLOOKUP is available in Excel for Microsoft 365 and recent perpetual versions such as Excel 2021 and 2024, but not Excel 2016 or 2019. An older alternative is =INDEX(E2:E5,MATCH("Mouse",B2:B5,0)).
6. Categorize Sales with IF
Goal: Label orders of at least 100 as High. Prompt: “Sales are in G2:G5. Write an IF formula in H2 that returns High for values at least 100 and Low otherwise.”
- Enter
=IF(G2>=100,"High","Low") in H2. - Fill the formula down through H5.
Check: H3 and H4 should be High; H2 and H5 should be Low. Test exactly 100 to confirm the boundary is inclusive.
7. Extract a Name from an Email Address
Goal: Extract the text before the at-sign. Prompt: “F2 contains alice.smith@example.com. Give me an Excel formula to extract everything before @, with an older-version-compatible approach.”
- In an empty cell, enter
=LEFT(F2,FIND("@",F2)-1). - Copy it down if you want to process the other addresses.
Check: The first result is alice.smith. A missing at-sign causes an error; ask ChatGPT for an IFERROR wrapper if malformed inputs are expected.
8. Clean Extra Spaces and Inconsistent Text
Goal: Normalize a region label. Prompt: “Cell I2 contains extra spaces around and between words. Produce a trimmed, uppercase version without changing the original.”
- Type
north west in I2, including extra spaces. - In J2, enter
=UPPER(TRIM(I2)).
Check: J2 displays NORTH WEST. TRIM handles ordinary spaces, but imported nonbreaking spaces may require an additional SUBSTITUTE step.
9. Find Duplicate Email Addresses
Goal: Flag addresses appearing more than once. Prompt: “Emails are in F2:F5. Give me a formula to label every repeated email Duplicate, including its first occurrence.”
- Enter
=IF(COUNTIF($F$2:$F$5,F2)>1,"Duplicate","Unique") in an empty column on row 2. - Fill down to row 5.
Check: The Alice addresses in rows 2 and 4 are flagged. The dollar signs keep the comparison range fixed as you copy the formula.
10. Split Full Names into Separate Columns
Goal: Separate a simple first and last name. Prompt: “I2 contains Alice Smith. How can I split it into first and last name columns using Excel’s interface?”
- Enter
Alice Smith in I2 and ensure J2 is empty. - Select I2, choose Data > Text to Columns, select Delimited, choose Space, and finish.
Check: I2 contains Alice and J2 contains Smith. This method overwrites destination cells and does not reliably model names with multiple parts; preserve the original and define your naming rules first.
11. Convert Text into Dates
Goal: Turn a predictable text date into an Excel date value. Prompt: “I2 contains the text 2025-01-15 in YYYY-MM-DD format. Give me a locale-independent formula using DATE and explain how to display it as a date.”
- Enter
'2025-01-15 in I2; the leading apostrophe makes it text. - Enter
=DATE(LEFT(I2,4),MID(I2,6,2),RIGHT(I2,2)) in J2, then apply a date format.
Check: J2 represents January 15, 2025. DATE can normalize invalid components rather than reject them, so validate untrusted source data separately.
12. Highlight Low Sales with Conditional Formatting
Goal: Visually mark sales below 60. Prompt: “Explain how to highlight cells below 60 in G2:G5 using Excel conditional formatting.”
- Select G2:G5, then choose Home > Conditional Formatting > Highlight Cells Rules > Less Than.
- Enter
60, choose a format, and confirm.
Check: The cells containing 50 and 40 are highlighted. The rule uses a strict threshold, so a value of exactly 60 is not highlighted.
13. Summarize Sales with a PivotTable
Goal: Compare total sales by region. Prompt: “My dataset has headers in A1:G1, Region in column C, and numeric Total Sales in G. Give steps for a PivotTable showing the sum by region.”
- Select A1:G5, choose Insert > PivotTable, and place it on a new worksheet.
- Drag Region to Rows and Total Sales to Values. If needed, change the value-field summary to Sum.
Check: North is 190, South is 120, and the grand total is 310. Refresh the PivotTable after changing source values; expand its source range if you add rows outside it.
14. Build a Sales Chart
Goal: Visualize the regional summary. Prompt: “I have PivotTable totals of North 190 and South 120. Explain how to create a clear column chart without plotting the grand total.”
- On a worksheet, enter Region and Sales headers, then North and 190, South and 120 beneath them.
- Select those three rows and choose Insert > Column or Bar Chart > Clustered Column.
Check: The chart has two categories and the North bar is taller. Add a descriptive title and check the axis before sharing it.
15. Create a Simple Sales Forecast
Goal: Extend the monthly sales series by one period. Prompt: “Monthly sales for periods 1–4 are 50, 120, 100, and 40. Show a linear Excel forecast for period 5 and explain its limitations.”
- Enter periods 1, 2, 3, and 4 in I2:I5 and the corresponding sales in J2:J5.
- Enter
=FORECAST.LINEAR(5,J2:J5,I2:I5) in J6.
Check: The estimate is 65. It assumes a linear relationship with equally spaced periods; four observations are insufficient to establish a reliable trend or seasonality. Treat the figure as an illustration, not a guarantee. In older Excel versions, use =FORECAST(5,J2:J5,I2:I5).
Check AI-Generated Results and Protect Your Data
A formula can be syntactically valid and still answer the wrong question. Treat the response as code submitted for review: compare it with requirements, inspect its dependencies, and test it against expected results before sharing or automating the workbook.
Test Formulas Before Applying Them
Work on a copy first. Check ranges, absolute and relative references, separators, and output formats. Test normal cases and boundaries: an exact threshold of 100, a missing email delimiter, an unmatched product, a blank cell, and duplicate lookup keys. For financial calculations, also check rounding rules and whether currency conversion or taxes are required.
If a result differs from your expectation, give ChatGPT the formula, the exact error or unexpected value, and a small reproducible example. Ask it to explain the cause rather than merely replacing the formula. Verify its revised answer independently, especially before filling thousands of rows.
Avoid Sharing Sensitive Workbook Data
Do not paste confidential business information or personal data into ChatGPT without appropriate authorization. Use fictional or properly anonymized examples, and review your organization’s AI, privacy, and data-handling policies. Removing names alone may not be sufficient if other fields can identify a person or transaction.
Start with One Excel Task
Choose a repetitive task you already understand, such as calculating sales or flagging duplicates. Describe the sheet, copy the suggested solution into a test workbook, and compare the result with a value you calculated yourself. Refine the prompt when the response misses a constraint.
Once a single example works, test edge cases and apply it to a copy of your real workflow. This prompt-copy-test cycle is useful for QA engineers and developers because it turns an AI suggestion into a reproducible, reviewable spreadsheet change.
FAQ
Can ChatGPT edit my Excel workbook automatically?
Not in the basic workflow described here. ChatGPT only knows what you provide, and you manually apply its suggestions in Excel. Some plans or integrations may support working with files, but capabilities, permissions, and availability depend on the specific setup.
Why does an AI-generated Excel formula return an error?
Common causes include incorrect cell references, text stored where numbers are expected, unsupported functions, and locale-specific separators. Check the exact error and your Excel version, then test a small known input. A formula can also return a number without an error while still being logically wrong.
Can I use these examples in older versions of Excel?
Most examples use widely available functions and interface features. XLOOKUP requires a supported newer version; INDEX and MATCH provide an older-compatible alternative. FORECAST can replace FORECAST.LINEAR in older versions. Interface labels may vary slightly across platforms and releases.
Is it safe to share spreadsheet data with ChatGPT?
Safety depends on the data, account settings, applicable policies, and authorization. Avoid sharing confidential or personal information unless your organization has approved the specific use. Prefer fictional examples and verify that anonymization cannot be reversed through other identifying fields.
Key Takeaways
- Describe the workbook, copy the proposed solution, and test it in Excel; do not assume ChatGPT can see your file.
- Provide column letters, sample values, Excel version, and the intended result for more useful prompts.
- Check formulas against known values and edge cases, including duplicate records and threshold boundaries.
- Use compatible alternatives for unavailable functions and treat forecasts as estimates, not promises.
- Protect sensitive data and experiment on a copy before changing a production workbook.