Skip to main content

Python for Excel

Python notebooks in Excel.

Boardflare adds a reactive Python notebook to the Excel workflow. Use Excel for workbook data, assumptions, review, and delivery; use the notebook for Python work that benefits from a coherent programming environment.

AppSource

Why a notebook?

One coherent Python workspace

Keep transformations, models, validation, Markdown, intermediate results, charts, diagnostics, and controls together instead of distributing substantial Python logic across worksheet coordinates.

The notebook is reactive: when an upstream value changes, marimo reruns dependent cells so code and outputs stay consistent.

Excel can consume the notebook

Read live workbook values through bf.inputs(), then expose selected notebook work back to Excel:

=BF.OUTPUT("summary")
=BF.FUNCTION("discount", A1, B1)

The complex implementation can remain centralized in Python while workbook users consume results and reusable functions where they need them.

The notebook can become the interface

A notebook can contain controls, tables, charts, explanations, and reactive outputs. When the same analysis becomes a repeatable tool, choose Open as: App to reopen it as a simplified app-style presentation of the same notebook.

App mode is optional. Many notebooks never need it.

The Python remains portable source

A marimo notebook is Python source. Boardflare saves that source with the workbook, while the underlying .py representation remains suitable for normal source-oriented practices such as review, diffing, backup, and version control when your workflow supports them.

:::note Current product boundary Saving the notebook stores its source with the Excel workbook. This documentation does not imply built-in Git synchronization or repository management. :::

The product model

The notebook and workbook are complementary surfaces. Returning results to Excel is useful when the workbook needs them; it is not a required final step for every notebook.

Learn by task

  • Getting started — use the bundled starter, connect live worksheet data, publish a result and function, save with the workbook, and safely upload/download Marimo .py source.
  • Working with Excel — read cells and ranges, return results with BF.OUTPUT(), create worksheet functions with BF.FUNCTION(), and check supported values and limits.
  • Boardflare vs. Microsoft Python in Excel — compare calculation order, source organization, type conversion, limits, runtime/security boundaries, packages, source export, and the scenarios where each approach fits better.
  • Building notebooks — understand marimo reactivity, structure larger analyses, use controls and charts, and work with packages in the browser runtime.
  • AI authoring — draft, revise, explain, and debug normal inspectable notebook Python.
  • App mode and sharing — use Open as: App, understand the presentation boundary, and validate a workbook before distribution.
  • Examples — see forecasting, reconciliation, optimization, cleaning, scientific analysis, and other complete patterns.
  • Excel ↔ Python type conversion — look up exact scalar, pandas, NumPy, date/time, missing-value, error, and spill behavior, and download the executable comparison harness.
  • Troubleshooting and reference — diagnose common failures and look up the exact public API contract.
  • Legacy Functions Editor — maintain workbooks that still use the earlier standalone function-authoring workflow.

Advanced implementation documentation

Most workbook authors do not need the transport internals. For engineering and security review:

  • Architecture and Runtime — shared-runtime startup, marimo/Pyodide ownership, capabilities, worksheet invocation, source lifecycle, persistence, and the legacy boundary.
  • Security and Data Flow — iframe trust boundaries, capability validation, executable-workbook risk, AI eligibility/context, external networking, packages, and persistence integrity.

What this is for

Boardflare is most compelling when the Python work is substantial enough to benefit from being understood as a coherent analysis or program while Excel still matters to the workflow. Common examples include:

  • cleaning and reshaping workbook data;
  • forecasting, regression, simulation, and statistical analysis;
  • optimization and constrained planning;
  • validation, reconciliation, controls, and exception analysis;
  • scientific and engineering analysis;
  • interactive analytical tools with controls and visualizations;
  • reusable calculations that should have one centralized Python implementation.

See Examples for worked patterns.

When another approach may be simpler

Use ordinary Excel formulas when they remain clear and maintainable. A small native Python-in-Excel calculation can also be a good fit when the Python naturally belongs to a worksheet cell. For a detailed technical comparison, see Boardflare vs. Microsoft Python in Excel.

Use external Python when the workflow centers on unrestricted file-system automation, scheduled jobs, desktop automation, databases, large batch processing, or packages that require capabilities unavailable in a browser runtime.

Need exact behavior or recovery help?

Use Troubleshooting and reference for API signatures and symptom-driven recovery. Use Architecture and Runtime or Security and Data Flow when you need the implementation model.