Focused Functions Editor
Python for Excel also includes a focused Editor workflow for creating reusable Python functions that behave like native Excel formulas. This path is separate from notebook-published BF.FUNCTION() functions and remains useful when the desired artifact is a calculation rather than a complete notebook application.
Quick example
def hello(name):
"""Return a greeting."""
return f"Hello {name}!"
=HELLO("World")
Create and save a function
- Open the Editor tab.
- Write a standard Python function with explicit parameters.
- Save the function to workbook settings.
- Type the function directly in a cell or insert it through the Function Dialog.

Function arguments and results
| Excel input | Python value |
|---|---|
| Number | float |
| Text | str |
| Boolean | bool |
| Empty cell | None |
| Multi-cell range | Two-dimensional list |
Supported results include numbers, strings, booleans, None, dates, and rectangular arrays that can spill into the worksheet.
Insert a function


Enter values directly or select worksheet ranges:


Insert options
| Option | Behavior | Best for |
|---|---|---|
| Insert as Formula | Inserts a live custom-function formula. | Reusable worksheet calculations |
| Insert as Result | Calculates once and writes the static value. | Frozen outputs |
| Insert as Excel PY | Inserts a native Microsoft =PY(...) formula when compatible. | Workbooks standardized on Microsoft Python in Excel |
Console and errors

For new multi-cell applications, start with the Notebook workflow. Use the focused Editor when a standalone worksheet function is the better abstraction.