How to Use ChatGPT for Excel (2026)

You don't need to memorize Excel formulas. ChatGPT can write them for you, IF you know how to ask. Most people type vague requests and get vague results. This tutorial shows you how to use ChatGPT for Excel the right way, with practical examples you can copy and use today.

How to Use ChatGPT for Excel (3 Steps)

Using ChatGPT for Excel follows the same pattern every time:

  1. Describe your data. Tell ChatGPT what your spreadsheet looks like: column names, data types, what's where. Instead of "I have sales data," say "Column A has dates in MM/DD/YYYY format, Column B has product names, Column C has unit prices, Column D has quantities sold."
  2. State what you want. Be specific about the outcome, not just the action. "Calculate total revenue per product" is better than "help with my spreadsheet."
  3. Copy, paste, test. Drop the formula into Excel and verify it works on your data. Test on a few rows first. If something looks off, paste the result back into ChatGPT and explain what went wrong.

The key is step one. The more context you give about your spreadsheet, the more accurate the formula.

The AI Academy dives deeper into these prompting principles. Learning how to give AI the right context is a skill that applies far beyond spreadsheets.

5 ChatGPT for Excel Examples You Can Use Right Now

1Generate a VLOOKUP Formula

Prompt

I have two sheets. Sheet1 has employee names in column A and department in column B. Sheet2 has employee names in column A and salary in column B. Write an Excel formula that adds the salary from Sheet2 into column C of Sheet1 by matching employee names.

ChatGPT gives you:

=VLOOKUP(A2, Sheet2!A:B, 2, FALSE)

Paste this into cell C2 on Sheet1 and drag down. The FALSE ensures exact matching. Without it, Excel does approximate matching, which produces wrong results for text lookups. For large datasets, ask ChatGPT to write it using XLOOKUP instead; it's faster and doesn't require the lookup column to be on the left.

2Build a Conditional Formula

Prompt

Column A has sales amounts. I want column B to show "Above Target" if the value in column A is greater than 10000, "On Target" if it's between 5000 and 10000, and "Below Target" if it's under 5000.

ChatGPT gives you:

=IF(A2>10000, "Above Target", IF(A2>=5000, "On Target", "Below Target"))

Nested IFs get unreadable fast. If you have more than three conditions, ask ChatGPT to use IFS instead; it handles multiple conditions without nesting.

3Clean Messy Data

Prompt

Column A has names in inconsistent formats (some uppercase, some lowercase, some with extra spaces). Write a formula to clean and standardize them to proper case with no extra spaces.

ChatGPT gives you:

=PROPER(TRIM(A2))

This strips leading/trailing spaces and converts "JOHN SMITH" or "john smith" to "John Smith." For messier data (phone numbers, dates stored as text, inconsistent abbreviations), tell ChatGPT what the messy version looks like and what the clean version should look like. It chains together the right combination of SUBSTITUTE, TEXT, and MID functions.

4Create a Simple Macro

Prompt

Write an Excel VBA macro that formats all cells in the selected range as currency with two decimal places, adds a light blue background, and bolds the header row.

ChatGPT gives you a complete VBA script that you paste into the Visual Basic Editor (Alt + F11 → Insert → Module → Paste). Run it, and your range is formatted instantly.

This is where ChatGPT saves the most time: writing macros that would take 20 minutes to code from scratch. You don't need to know VBA syntax. Just describe what the macro should do step by step. Common macros worth requesting include auto-sorting by a specific column, removing duplicate rows, or splitting data across multiple sheets based on a category column.

If you want to master these kinds of AI-assisted productivity workflows, our AI Academy walks through them with real-world examples you can apply immediately.

5Analyze Data Patterns

Prompt

Here's my monthly sales data: [paste your data]. What trends do you see? Which months are strongest? Suggest a formula to calculate the month-over-month growth rate.

ChatGPT gives you:

  • A plain-English analysis of your data
  • The formula: =(B3-B2)/B2*100 for percentage growth
  • Suggestions for visualizing the trend

Paste actual numbers when you can. ChatGPT spots seasonal patterns, identifies outliers, and suggests the right chart type, faster than manual inspection.

More Excel Formulas ChatGPT Can Write for You

SUMIFS: Conditional Totals

Prompt

Column A has dates, Column B has sales rep names, Column C has revenue. Write a formula to calculate total revenue for "Sarah" in January 2026.

ChatGPT gives you:

=SUMIFS(C:C, B:B, "Sarah", A:A, ">="&DATE(2026,1,1), A:A, "<="&DATE(2026,1,31))

SUMIFS is one of the most powerful Excel functions, and one of the hardest to write from memory. ChatGPT handles the syntax perfectly, including the tricky date comparison operators that trip most people up.

Pivot Table Setup

ChatGPT can't create a pivot table directly, but it can tell you exactly how to set one up. Try this prompt:

I have sales data with columns: Date, Product, Region, Salesperson, Revenue, Units Sold. I want to see total revenue by region and product, with months across the top. Walk me through creating the pivot table.

You'll get step-by-step instructions for which fields to drag where: rows, columns, values, and filters.

Data Validation Rules

Prompt

I want Column B to only allow values that exist in a list on Sheet2 in Column A. How do I set up data validation for this?

ChatGPT walks you through: Data tab → Data Validation → Allow: List → Source: =Sheet2!$A$1:$A$100. This is the kind of task where knowing how to ask matters more than knowing Excel, the same principle behind using AI to handle routine work tasks more efficiently.

ChatGPT for Google Sheets

Everything in this guide works with Google Sheets too, with a few differences worth knowing. For a dedicated walkthrough of Gemini's built-in AI features in Sheets (including the =AI() function), see our guide on how to use AI in Google Sheets. Most Excel formulas (VLOOKUP, IF, SUMIFS, TRIM, PROPER) use identical syntax in both.

The key differences are that Google Sheets uses ARRAYFORMULA() instead of Ctrl+Shift+Enter for array formulas. It also has exclusive functions like IMPORTRANGE (pull data from other spreadsheets), GOOGLEFINANCE (stock prices), and QUERY (SQL-like filtering). ChatGPT writes all of these well.

For macros, Google Sheets uses JavaScript-based Apps Script instead of VBA. If you ask ChatGPT to write a macro, specify "Google Apps Script" so it generates the right language. Always mention whether you're using Excel or Google Sheets; the answer might be identical, but when it's not, the difference matters.

Advanced Use Cases for ChatGPT and Excel

Dashboard Creation

ChatGPT can plan an entire dashboard for you. Try: "I have 12 months of marketing data with columns: Channel, Spend, Clicks, Conversions, Revenue. Design a dashboard showing ROI by channel, monthly spend trends, and conversion rate over time." It lays out the structure cell by cell: calculated fields, chart types, and cell references. This kind of analysis is also useful for market research projects where you need to organize and visualize competitive data quickly.

Financial Modeling

For finance teams, ChatGPT writes the formulas behind revenue projections, loan amortization schedules, and scenario analysis. Try: "Build a 12-month revenue projection starting at $50,000 with 8% monthly growth for months 1-6, then 5% for months 7-12. Include cumulative revenue and a row showing when we hit $500,000 total." ChatGPT produces the growth formulas, the cumulative SUM, and a MATCH-based formula that identifies the breakeven month.

Project Tracking

Excel is still the go-to for project management in teams that don't want dedicated software. ChatGPT generates formulas for task completion percentages, deadline tracking with conditional formatting, and Gantt chart setups. Ask it to "Write a formula that highlights the row red if the due date in Column E has passed and the status in Column F isn't 'Complete'" and you'll get a conditional formatting rule ready to apply.

Tips for Better Results

Be specific about columns. "Column A has dates, Column B has revenue, Column C has product names" beats "I have a sales spreadsheet."

Paste sample data. Copy 5-10 rows of your actual data and paste it into ChatGPT. It'll tailor the formula to your exact structure.

Ask ChatGPT to explain. Add "and explain how this formula works" to any prompt. Understanding the formula helps you modify it later without going back to ChatGPT.

Always test first. ChatGPT sometimes gets column references wrong. Test every formula on a small sample before applying it to your full dataset.

Iterate when it's wrong. Don't start over. Paste the formula and error back into ChatGPT ("This returns #VALUE! on rows where the date cell is empty") and it'll add the error handling you need.

That iterative approach to working with AI is a core concept in the AI Academy. The lessons teach you how to refine AI outputs across all kinds of professional tasks, not just Excel.

Limitations to Know

ChatGPT doesn't see your spreadsheet. It works from your description, so if you describe your data wrong, the formula will be wrong too. For tasks that need direct spreadsheet access, look into Microsoft's built-in Copilot or Excel add-ins like Numerous.ai.

FAQ

Can ChatGPT write Excel macros and VBA code?

Yes. ChatGPT writes complete VBA macros you can paste directly into Excel's Visual Basic Editor (Alt + F11). Describe what the macro should do step by step, and it generates working code for tasks like formatting, sorting, deduplication, and data splitting across sheets.

Does ChatGPT work with Google Sheets too?

Most Excel formulas (VLOOKUP, IF, SUMIFS, TRIM, PROPER) use identical syntax in Google Sheets. The main differences are that Google Sheets uses ARRAYFORMULA() for array formulas and Apps Script (JavaScript) instead of VBA for macros. Specify which platform you're using so ChatGPT generates the right syntax.

How do I get accurate formulas from ChatGPT?

Describe your spreadsheet structure in detail: column names, data types, and specific cell references. Paste 5-10 rows of sample data when possible. The more context you provide about your data layout, the more accurate the formula will be.

Can ChatGPT analyze my Excel data directly?

ChatGPT cannot open or read your spreadsheet files. It works from whatever description or data you paste into the chat. For direct spreadsheet analysis, use Microsoft Copilot (built into Excel) or specialized add-ins that connect to your files.

What Excel functions does ChatGPT handle best?

ChatGPT excels at lookup functions (VLOOKUP, XLOOKUP, INDEX/MATCH), conditional formulas (IF, IFS, SUMIFS, COUNTIFS), data cleaning (TRIM, PROPER, SUBSTITUTE), and date calculations. It also writes complex nested formulas and explains how each part works.


Use AI across your entire workflow, from spreadsheets to presentations to project management.

The AI Academy offers 300+ courses, tutorials, and hands-on exercises to help you master ChatGPT for Excel, data analysis, and productivity workflows.

Start your free 14-day trial →

Related Articles
Blog Post

ChatGPT for Market Research: Full Guide (2026)

Learn how to use ChatGPT for market research: competitor analysis, buyer personas, survey design, trend analysis, and prompts that deliver results.

Tutorial

How to Use ChatGPT for Coding (2026 Guide)

Learn how to use ChatGPT for coding: writing code, debugging, refactoring, and learning new languages. Includes prompts and a Copilot/Cursor comparison.

Tutorial

How to Use ChatGPT for Job Search (2026)

Learn how to use ChatGPT for job search. Covers resume tailoring, cover letters, interview prep, company research, and follow-up emails with prompts.

Feeling behind on AI?

You're not alone. Techpresso is a daily tech newsletter that tracks the latest tech trends and tools you need to know. Join 500,000+ professionals from top companies. 100% FREE.