AI tools
AI for Excel and spreadsheets: formulas, cleaning and analysis
AI can write the formula you cannot remember and clean the data you dread. It can also be confidently wrong, so here is how to use it and check it.

What AI can do for spreadsheets
Using AI for Excel does not replace spreadsheet skills. It speeds up the boring parts and helps you learn faster. The most useful jobs are:
- Writing formulas from a plain-language description, such as 'sum sales for the North region in March'.
- Explaining formulas someone else wrote, step by step.
- Cleaning data: fixing names, dates, spaces, duplicates and mixed formats.
- Analysis and summaries: spotting trends, outliers and writing a short explanation.
- Charts and layout ideas, such as which chart suits which data.
- Debugging errors like #N/A, #REF! or a formula that gives the wrong result.
It is worth building the basics too. Our free Excel course covers formulas, PivotTables and Power Query, so you can judge what the AI gives you.
Your options: built-in AI or a chatbot
There are two main routes, and many people use both.
1. AI inside the spreadsheet app. Microsoft offers Copilot in Excel for people with the right Microsoft 365 licence, and Google Sheets has Gemini features in some plans. These tools can see your sheet, so you can ask questions in place. Availability depends on your plan, your region and your organization's settings, so check the vendor's help page. Our free Microsoft 365 Copilot at Work course covers this route, and our Copilot guide explains the product family.
2. A general chatbot. ChatGPT, Gemini, Claude and others can write and explain formulas if you describe your columns. They do not see your file unless you upload it, and some offer add-ins or file analysis features. This route works even on a free plan. See ChatGPT vs Gemini vs Claude.
Step by step: get a correct formula from AI
- Describe your layout. Say which columns hold what: 'Column A is date, B is region, C is sales amount, starting in row 2.'
- State the goal in plain words. 'I want the total of column C where B is North and the month in A is March.'
- Name your tool and version. Excel on Windows, Excel for the web or Google Sheets. Some functions are not available everywhere.
- Ask for an explanation of each part and one test example.
- Paste and test on three rows you can check by hand.
- If it errors, paste the exact error and the formula back to the assistant and ask what is wrong.
- Save good formulas in a notes sheet for reuse.
Good instructions make a big difference, and our free Prompt Engineering course shows how to write them.
Cleaning messy data with AI
Data cleaning is where AI saves the most time. Typical tasks:
- Split 'Surname, First name' into two columns.
- Standardize dates written in different formats.
- Remove extra spaces and fix capital letters.
- Group similar spellings, for example 'Casablanca', 'casa blanca' and 'Casa'.
- Find duplicates and explain which rows are affected.
Ask the AI to suggest formulas, a Power Query step or a small script, and apply it to a copy of your data. Letting an AI rewrite your original sheet without a backup is risky. If you want to go further, the free Data Analytics Foundations and SQL for Data Analysis courses build the next skills.
Analysis, summaries and charts
Once your data is clean, ask questions in plain English: 'Which product had the biggest drop between Q1 and Q2?', or 'Write three sentences a manager can read about this table.' AI is good at drafting the story, but you must check the numbers behind it.
For charts, describe your goal ('compare monthly sales for three regions') and ask which chart type fits, then build it yourself. For dashboards, see Data Visualisation and Dashboards. For wider data use, read AI for data analysis.
The mistakes to avoid
- Trusting without testing. A formula can look right and be wrong, especially with ranges, blank cells and text that looks like numbers.
- Uploading private data. Do not send customer lists, payroll or confidential files to a tool you do not control. Follow your organization's rules and see our privacy tips.
- Ignoring the version. A modern function may not exist in an older Excel.
- Hard-coded numbers. Ask the AI to refer to cells, not to type values into formulas.
- No backup. Always keep an original copy.
Five prompts you can copy today
- Formula: 'Column A has dates, B has product names, C has amounts. Write an Excel formula that totals amounts for product X in a chosen month. Explain it and give a test example.'
- Explain: 'Explain this formula step by step as if I am new to Excel: [paste formula].'
- Clean: 'These names are written in different ways. Suggest a way to make them consistent using formulas or Power Query.'
- Check: 'Look at these column headers and sample rows and list possible data quality problems.'
- Summarize: 'Write three plain sentences for a manager about this table. Only use numbers I gave you.'
Replace the brackets with your own details. Specific prompts give better results than short ones, as we explain in our prompt engineering tips.
A realistic example: monthly sales report
Suppose you receive a messy export of sales each month. A workable routine is: paste the column headers and a few anonymised rows into an assistant, ask for cleaning steps, apply them to a copy, ask for a summary formula and a PivotTable plan, build the table yourself, then ask the assistant to draft three bullet points about the main changes. Check every figure against the totals in the original file. The first time takes longer, but you end with a repeatable process and a saved prompt. That is the real gain: not magic, but a faster loop with human checking at the end.
Build a habit that scales
Treat AI as a fast junior colleague: it drafts, you review. Keep a prompt library for tasks you repeat, such as monthly reports. When a task becomes regular, think about automating it, as covered in AI workflow automation and the AI Workflows and Automation course.
Quick tricks to try today
- Describe your columns and row numbers before asking for a formula.
- Say which app and version you use (Excel, Excel for the web, Google Sheets).
- Ask the AI to explain each part of a formula and give a test example.
- Test every formula on three rows you can verify by hand.
- Paste the exact error message back to the AI when a formula fails.
- Work on a copy of your data when cleaning; keep the original untouched.
- Ask for cell references instead of hard-coded numbers.
- Use AI to explain someone else's complicated formula before you edit it.
- Ask for a 3-sentence manager summary of a table, then verify each number.
- Do not upload confidential data to tools your organization has not approved.
- Save working formulas and prompts in a notes sheet.
Frequently asked questions
Can AI write Excel formulas for me?
Yes. Describe your columns and goal, and a chat assistant or Copilot can draft the formula. Always test it on a few rows you can check by hand.
Do I need Copilot to use AI with Excel?
No. You can use a general chatbot to write and explain formulas and copy them in. Copilot in Excel needs the right Microsoft 365 licence.
Is it safe to upload my spreadsheet to an AI tool?
Only if the data is not confidential and the tool is approved for your use. Remove names and sensitive columns, or follow your organization's AI policy.
Can AI clean messy data?
It can suggest formulas, Power Query steps or scripts to fix dates, spaces, duplicates and spelling. Run them on a copy and check the results.
Will AI replace learning Excel?
No. You still need the basics to check the output. AI makes learning faster, but errors cost money, so understanding matters.
Sources
Sources were checked on 29 November 2026; AI products change fast, so check the publisher for later updates.
- Microsoft Support - Get started with Copilot in Excel support.microsoft.com
- Microsoft Support - Excel functions (by category) support.microsoft.com
- Google Docs Editors Help - Google Sheets support.google.com
- OWASP Top 10 for LLM Applications (data risks) owasp.org


