=PY() heavily in Module 8; everywhere else, regular Python + the Anaconda setup is enough. If you can get the company 365 license, do.
In Excel, go to File → Account → Update Options → Update Now. Make sure you're on a recent build. Python in Excel is generally available in Microsoft 365 since 2024.
Open a fresh workbook so you don't accidentally break a real one.
Click cell A1. Type =PY( — when you do this, Excel switches the cell into Python mode. You'll notice the formula bar turns into a multi-line area and shows a little green "PY" badge.
Inside the cell, type:
1 + 1
Press Ctrl+Enter (Windows) or Cmd+Enter (Mac) to commit. After a brief "calculating in the cloud" moment, the cell shows 2.
Click another empty cell, type =PY(, then:
import pandas as pd
df = pd.DataFrame({"city": ["NYC", "LA", "Chicago"], "pop_m": [8.3, 3.9, 2.7]})
df
Ctrl+Enter. Excel now shows the DataFrame as a special "Python object" cell. Right-click it → Output as → Excel values to spill it into proper Excel cells.
When you type =PY( Excel sends your code to Microsoft's cloud, runs it in a real Python interpreter (with pandas, NumPy, matplotlib pre-installed), and returns the result back into your spreadsheet. Total round trip: usually 1–3 seconds.
=PY() needs Microsoft 365 Excel.=PY( then your Python, then Ctrl+Enter.In a fresh Excel sheet, get this to work end-to-end:
=PY(
import pandas as pd
ages = pd.Series([24, 31, 45, 22, 38])
ages.mean()
)
You should see 32 in the cell. If you do — Python in Excel is on, and Module 8 will be a breeze.