Open Excel, click the Formulas tab, and look for a Python group (Insert Python, Initialization, Python Editor). If it's there, you're set. If not, work through the checklist below.
| Requirement | What to check |
|---|---|
| Subscription | Microsoft 365 (Business/Enterprise, or Family/Personal). Python in Excel is not in perpetual-licence Excel (2019/2021/2024). |
| Excel build | Windows: Current Channel or Monthly Enterprise Channel version 2408+; Semi-Annual Enterprise Channel 2502+. Also available in Excel for the web. Mac support is rolling out: check the availability page. |
| Compute | Standard compute is included; a paid Python in Excel add-on buys premium (faster) compute. You do not need the add-on for this course. |
| Network | Code runs in Microsoft's cloud, not on your PC. Corporate tenants can disable it: if you see the ribbon group but formulas return errors, ask IT. |
Official references: Introduction to Python in Excel · Get started · Add-on licensing FAQ
- Formulas → Insert Python
- Type
=PY(in any cell - Ctrl+Alt+Shift+P
Press Ctrl+Enter to run (plain Enter runs too but moves selection). Esc backs out of a half-typed cell.
| Keys | Does |
|---|---|
| Ctrl+Alt+Shift+P | Insert Python cell |
| Ctrl+Enter | Commit/run |
| Ctrl+Alt+Shift+M | Toggle Python Object ↔ Excel Value (spill DataFrames, render charts) |
| Ctrl+Alt+Shift+F | Toggle full/partial calc mode |
Full list: Python in Excel keyboard shortcuts
Formulas → Python → Initialization shows the defaults: numpy as np, pandas as pd, matplotlib.pyplot as plt, seaborn as sns, statsmodels as sm. Everything else (SciPy, scikit-learn, NLTK…) is installed but must be imported in your cell. Which libraries exist: Open-source libraries and Python in Excel · Initialization settings
- Put data in an Excel Table (Ctrl+T) before pointing Python at it.
xl("table_name[#All]", headers=True)is the pattern for the whole course. - Python runs top-to-bottom, left-to-right across the workbook. A cell can only see objects defined above/left of it. If you get
#PYTHON!when referencing a variable, that's usually why.
Troubleshoot Python in Excel errors covers #PYTHON!, #BUSY!, #CONNECT!, #BLOCKED!, #TIMEOUT!. The Python Editor pane shows the full error text and traceback.
Download the course zip and keep the folder structure. Every module has a starter.xlsx (open this) and a solution.xlsx (finished state). Never overwrite the starter: Save As with your name.