Lesson theory
Python in Excel is the =PY() function, which runs Python code right in a cell. The code is calculated
in the Microsoft cloud, so it needs a Microsoft 365 subscription and an internet connection. Check Microsoft's documentation for the current list of supported platforms and plans.
df = xl("A1:C500", headers=True) # range -> pandas DataFrame
df.groupby("City")["Amount"].sum() # totals by cityPopular libraries are available, including pandas, NumPy, Matplotlib and seaborn. You can return the result as an Excel value or as a Python object (a DataFrame or a chart).
Copilot in Excel helps you write formulas, explains them, and builds PivotTables and charts from a plain-language request. Analyze Data is another built-in way to explore a table. But check what AI gives you: recalculate a few values by hand, read the formula, and don't send confidential data anywhere your company's policy forbids.
Test yourself
Enter — commit · F2 — edit · F4 — $ in a reference · Ctrl+C/Ctrl+V — copy and paste · Ctrl+Z — undo
Esc or F6 — leave the sheet for the «Check» button · Shift+Tab in the first cell — back to the page