Python in Excel is a new feature that allows you to write Python code directly in Excel cells using the PY function. You can use Python to perform advanced data analysis, create advanced visuals, automate tasks, and access popular Python libraries. However, Python in Excel is currently in preview and is subject to change based on feedback.
Advertisement
It is only available for Excel on Windows users who join the Microsoft 365 Insider Program and choose the Beta Channel Insider level. Moreover, Python calculations run on the Microsoft cloud, so you need an internet connection to use this feature.
Advertisement

To use Python in Excel, you need to enable the Developer tab in the ribbon and select Insert Python from the Formulas tab. This tells Excel that you want to write a Python formula in the selected cell. Alternatively, you can use the function =PY in a cell to enable Python. After entering =PY in the cell, you can enter Python code directly into the cell. Y
ou can also reference Excel objects like ranges, tables, queries, and names using the custom Python function xl(). For example, to reference cell A1 use xl(“A1”) and for the range B1:C4 use xl(“B1:C4”).


Leave a Reply