advanced Estimated learning time: 4 h

6.4 Python in Excel

You can run a real analysis inside a workbook, and know whether your licence allows it.

Before:04. Excel — Cleaning & Power Query

Python in Excel puts real DataFrames inside a PY cell, computed in Microsoft's cloud, with results landing back in the grid. This topic closes the automation module because it is where Excel meets the analysis world beyond it. Licensing and quota come first for a practical reason: the feature needs particular paid plans, and knowing whether yours has it beats discovering mid-project. The common confusion is where the code runs — not on your machine, which explains both the pauses and the restrictions — plus the judgement call of when a proper notebook outside Excel is the better home for the work.

Work through these

  • Where it runs, on which plans, and the compute quota

    Where the code actually runs, which plans include it, and the limits on how much computation you get. Checking this first avoids building on something your licence does not cover.

  • The PY cell, DataFrames and returning values to the grid

    Code lives in a cell, works with tabular data structures, and hands results back to the grid. That last step is what makes it part of the spreadsheet rather than a separate tool.

  • Charts from Python inside Excel

    Charts produced by code appear in the sheet like any other object, which brings a much wider range of plots into a workbook. It is the most visible benefit of the feature.

  • When to use it and when to move the work to a notebook

    For exploratory work in a workbook other people will open, this is a good fit; for a substantial analysis, a notebook is the better home. Knowing the boundary keeps the workbook sane.

Sign in to keep your progress.

Free resources

We haven't checked most of these for screen reader use yet.

Links last checked 29 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.