Skip to main content
use-ai-in-excelexcel-automationdesktop-ai-agentlocal-first-aispreadsheet

How to Use AI in Excel on Your Desktop — Lapu AI

Lapu AI Team9 min read

To use AI in Excel today you have three honest options: Microsoft 365 Copilot inside Excel, a free web widget that generates one formula at a time, or a desktop AI agent that opens your workbook on your own machine and edits it in place. Each one fits a different job and a different trust model — Copilot is best for in-flow chat help on cloud-stored sheets, widgets are best for a single formula you can paste, and a desktop agent is best when the data should stay on your computer and the work spans many steps or many files. This guide walks each option in detail, with the specific Excel tasks that each one handles well and the cases where it breaks down.

Three-row spreadsheet panel comparing the three ways to use AI in Excel: Copilot in cloud, web widget for formulas, desktop agent on local file

The conversation about "AI in Excel" usually starts and stops at Microsoft 365 Copilot, because that is the option Microsoft markets directly inside the app. Copilot is a strong product. It is also not the only option, and on machines where the workbook is sensitive or where the work spans more than one file, it is often the wrong option.

How do I use AI in Excel?

You have three options. Inside Excel, Microsoft 365 Copilot adds a chat pane that drafts formulas, summarizes data, and builds charts — it needs an M365 Copilot license and the file on OneDrive with AutoSave on. Web widgets like Formula Bot generate one formula from a prompt. A desktop AI agent opens the .xlsx on your disk and runs multi-step work locally, with a permission gate on every write.

The third option is the one most "how to use AI in Excel" guides skip. It is also the closest analog to the way a junior analyst would work for you: read the file, do the work, save the file, and check in when something is unclear.

Can AI read Excel files locally without uploading them?

Yes. A desktop AI agent loads your .xlsx with a local library such as openpyxl, reads cells and formulas in process, and writes the file back to disk. The workbook never goes to a vendor server. By contrast, Microsoft 365 Copilot in Excel requires the file to be saved on OneDrive with AutoSave enabled, so the file body is in Microsoft's cloud (Microsoft, 2026).

The architecture matters more than the model. If the AI you trust the most still requires the workbook to be on a cloud drive before it can read it, the privacy boundary has already moved — the model is fine; the file is just no longer on your machine. A desktop agent keeps the file where it is and brings the model to the file, not the file to the model.

Three ways to use AI in Excel

The three options trade off the same axes: where the file lives, what the AI is allowed to touch, and how much of the workflow it can do end-to-end.

OptionFile locationBest forLimits
Microsoft 365 Copilot in ExcelOneDrive (AutoSave on)Formula drafting, chart summaries, in-flow chat on a single sheetRequires M365 Copilot license; file must be in the cloud; bounded to the active workbook
Web formula widget (Formula Bot, GPTExcel)Stays local — you paste a description, not the fileOne-off formulas, regex, conditional formatting expressionsThe tool never sees the data; cannot do anything beyond writing the formula string
Desktop AI agent (Lapu AI)Wherever the file is on your diskMulti-step work across sheets and files; bulk fill; dedup; reconciliation; .xlsx round-trip from PDF or CSVNeeds a desktop install and permission to read/write the path

Copilot lives where most users already are — inside the Excel ribbon — and that is its real strength. You can ask it "summarize this sheet", "draft a SUMIFS for column F by region", or "make a chart of monthly revenue", and it answers without ever leaving the workbook. Microsoft's own walkthrough is the canonical reference for the in-app Copilot flow.

Web widgets do one job — turn an English description into an Excel formula — and they do it without ever touching your data. That is a real privacy property. It is also a hard ceiling: the widget can write =IFERROR(VLOOKUP(A2,Sheet2!A:C,3,FALSE),"") for you, but it cannot actually run that formula against your 18,000-row contract list, deduplicate the result, write the cleaned set to a second tab, and email a summary to your team. That last set of jobs is what people mean when they say they want "an AI Excel agent" — and that is the desktop-agent shape.

How a desktop AI agent uses your Excel files

A desktop AI agent treats your .xlsx the way a Python script does — except it writes the script itself, in response to a sentence of intent.

The pipeline runs four steps locally on your machine:

  1. Open the workbook. The agent uses a local Excel library (openpyxl on Python, ClosedXML on .NET, the Excel COM bridge on Windows) to load the file from disk. No upload. The library can either return cached values (last calculated) or the original formula strings — a capable agent uses the formula view so it can rewrite, not just read.
  2. Read what it needs. Sheet names, column headers, the first N rows, any named ranges. The agent does not load the whole workbook into the model's prompt; it loads enough structure to plan.
  3. Plan and execute the work. The plan is a sequence of cell edits, formula writes, sheet additions, or shell calls (run a Python pandas pass, hit an internal API, fetch a PDF, etc.). Each write is gated: on Lapu AI, the agent asks before it touches your filesystem.
  4. Save in place or to a new file. The output is a clean .xlsx that opens directly in Excel — real number types, real dates, formulas where they belong, no string-typed amounts that block downstream SUM.
# What the agent actually runs locally — no upload, no API key for the file path itself
from openpyxl import load_workbook

wb = load_workbook("/Users/you/Downloads/Q2-vendors.xlsx", data_only=False)
ws = wb.active

# Add a new column with a formula the agent wrote
ws.cell(row=1, column=ws.max_column + 1, value="margin")
for r in range(2, ws.max_row + 1):
    ws.cell(row=r, column=ws.max_column, value=f"=(B{r}-C{r})/B{r}")

wb.save("/Users/you/Downloads/Q2-vendors-with-margin.xlsx")

That four-step shape is the same pipeline our PDF-to-Excel guide on the desktop describes for converting a vendor invoice into a clean workbook — the read-side just starts at a PDF instead of an .xlsx. For the broader pattern of running automation on your own machine instead of through a SaaS connector grid, see AI automation without Zapier.

Tasks that fit a desktop agent better than Copilot

Copilot is one chat pane inside one workbook. A desktop agent is a process on your machine with access to your filesystem. That gap shows up as soon as the work crosses a single sheet.

  • Bulk-fill a column across thousands of rows. Score a list of customer comments by sentiment, classify product SKUs into categories, write a one-line summary per row. Copilot can suggest the formula or model; a desktop agent actually runs it on every row and writes the result back without you re-prompting per chunk.
  • Reconcile two workbooks against each other. Open vendors-2026Q1.xlsx, open gl-export-q1.xlsx, match on invoice number, write a third workbook of mismatches. This is a three-file job — out of scope for an in-workbook Copilot chat by design.
  • Round-trip a PDF or CSV into the spreadsheet. Read the source file, extract the table, type-coerce, write the .xlsx. The Excel team built the Power Query PDF connector for this; a desktop agent does the same job for files that the connector cannot parse cleanly, and writes the result without the user having to step through M code. See the best AI agent for Excel automation page for the full task list.
  • Clean a messy export. Standardize date formats, dedupe rows by composite key, strip currency symbols, flag rows that fail a regex. The data-cleanup agent pattern walks the dedup and normalization mechanics in detail.
  • Refuse to upload at all. Workbooks that contain banking details, personally identifiable information, salary data, or under-NDA vendor pricing should not move to a cloud drive just to get summarized. A desktop agent reads them where they are.

The connective tissue is that the work either crosses files, runs over many rows, or has to stay on the machine — three shapes that a single-workbook Copilot chat is not built for.

When Microsoft 365 Copilot is still the better choice

A desktop agent is not a replacement for Copilot. Copilot wins on the jobs it was built for.

  • You are already in Excel with the file open and you want one formula, one chart, or one summary right now. Copilot answers in the same window with zero context switch.
  • The workbook is already on OneDrive or SharePoint because it lives in a shared team folder, and the data is not sensitive.
  • You want suggested PivotTable layouts, conditional formatting rules, or "what does this column mean" plain-English summaries inside the workbook.
  • You want an AI that respects the Microsoft 365 admin policies your IT team already configured (DLP, retention, eDiscovery).

The two tools sit at different layers. Copilot is an AI feature inside Excel; a desktop agent is an AI user of your Excel files (and your filesystem, and your terminal, and your other apps). Pick by the job: ask Copilot inside the workbook, ask the desktop agent when the job spans more than one file or has to stay off the cloud. For the broader trade-off between in-app AI and an agent that lives outside the app, the local-first AI versus cloud AI guide is the longer read.

FAQ

How do I use AI in Excel?
You have three options. Inside Excel, Microsoft 365 Copilot adds a chat pane that drafts formulas, summarizes data, and builds charts — it needs an M365 Copilot license and the file on OneDrive with AutoSave on. Web widgets like Formula Bot generate one formula from a prompt. A desktop AI agent opens the .xlsx on your disk and runs multi-step work locally, with a permission gate on every write.
Can AI read Excel files locally without uploading them?
Yes. A desktop AI agent loads your .xlsx with a local library such as openpyxl, reads cells and formulas in process, and writes the file back to disk. The workbook never goes to a vendor server. By contrast, Microsoft 365 Copilot in Excel requires the file to be saved on OneDrive with AutoSave enabled, so the file body is in Microsoft's cloud.
What is the best AI Excel agent for a regulated machine?
Pick the agent that reads and writes the workbook locally and that requires explicit approval for each file write. On Lapu AI that means opening the .xlsx from your disk, using a local Excel library to edit it, and producing the new workbook in place — no upload, no third-party converter, no API key needed for the file path itself.
Can AI read Excel formulas, not just values?
Yes if the underlying library supports it. openpyxl can return either the formula string (`=SUM(B2:B30)`) or the cached calculated value, depending on the load mode. A capable desktop AI agent uses the formula view so it can rewrite or extend formulas, not just read the last calculated number.
Does using AI in Excel require an internet connection?
Microsoft 365 Copilot in Excel does — it talks to Microsoft's cloud model and needs the file on OneDrive. A desktop AI agent needs the internet only for the model layer it routes to; the file read, file write, and any local Python or shell steps run on your machine, so a fully on-device model can run the whole pipeline offline.
Can AI generate Excel formulas without seeing my data?
Yes. Free web widgets like Formula Bot do exactly that — you describe the formula in English, the tool returns the formula, and you paste it into Excel. The widget never sees your sheet. This is fine for a one-off formula but not enough when the work spans many rows or many sheets.
How is a desktop AI agent in Excel different from a macro?
A macro is a pre-recorded script that runs the same way every time. A desktop AI agent reads the prompt, inspects the workbook, plans the steps, and writes the macro or formula it needs — adapting to the file in front of it. Macros are great when the job repeats exactly; an agent is better when the job is new each time.
Is there a local AI for Excel that does not need Microsoft 365?
Yes. A desktop AI agent runs against any .xlsx on your filesystem without an M365 license, OneDrive, or Copilot subscription. The agent uses a local Excel library to read and write the file; the only requirement is that the file is on a path the agent has permission to open.

Sources

  1. How To Use AI in ExcelMicrosoft (2025-09-01) · accessed 2026-06-23
  2. Frequently asked questions about Copilot in Microsoft 365 subscriptionsMicrosoft Support (2026-01-15) · accessed 2026-06-23
  3. openpyxl — A Python library to read/write Excel xlsx/xlsm filesopenpyxl project (2025-05-01) · accessed 2026-06-23
  4. Power Query PDF connectorMicrosoft (2025-08-01) · accessed 2026-06-23
ShareXLinkedIn

Lapu AI Team

Building the future of desktop AI agents. Lapu AI combines frontier language models with native system access to automate real tasks on your computer.

Related articles

Automate the work between you and outcomes

Lapu AI handles the repetitive work between you and outcomes. One desktop agent, zero tab-switching. Available now on macOS and Windows.

  • 1-click uninstall
  • Cancel anytime
  • Files never leave your computer

Free to start. Cancel in 1 click. Files stay on your machine.

Lapu AI agent chat with conversation, tool calls, and execution log