Skip to content
Excel & Education

Excel Experiments

Mathematical and computational experiments that push spreadsheets far beyond their usual job: fractals, 3D projection, simulation, and custom functions, built entirely in Excel.

A zoomed region of the Mandelbrot set rendered in Excel, with cyan spirals and filaments on a deep navy background.

Excel is usually described as a tool for accounting. It’s also a grid of a million tiny calculators that can all talk to each other, which makes it a surprisingly capable environment for mathematics, graphics, and simulation. These experiments are attempts to find the edges of the program.

Formula-driven fractal generator

A Mandelbrot set visualizer built entirely in Excel, using custom formula logic and conditional formatting, with dynamic zoom and color mapping. Each cell stands for a point cc on the complex plane and repeatedly applies

zn+1=zn2+c,z0=0,z_{n+1} = z_n^{2} + c, \qquad z_0 = 0,

counting how many iterations it takes for ∣zn∣|z_n| to escape past 2. Points that never escape belong to the set; the escape count of every other point becomes its color, and conditional formatting turns the grid into the image.

A detailed region of the Mandelbrot set rendered by Excel cells, showing cyan spirals on navy.
A zoomed region of the Mandelbrot set. Each pixel is a spreadsheet cell; each color is an escape-time count.

The same escape-time algorithm runs below in your browser. Click anywhere to zoom in.

Scroll into view to render

Live demo: the same escape-time calculation the spreadsheet performs cell by cell, here computed per pixel in your browser. Click to zoom toward a point; Shift-click to zoom out.

Custom LAMBDA functions

Using Excel Labs, I write bespoke functions with LAMBDA and LET so complex logic can be reused like any built-in function. WRAPROWS.UNEVEN, for example, turns a single stacked column of items and their attributes into a tidy table, even when each item has a different number of attributes, which the built-in WRAPROWS can’t handle.

Excel sheet with a stacked list of items and attributes on the left, the reshaped table produced by =WRAPROWS.UNEVEN(C7:C25, "Item") on the right, and the LET formula behind it.
One formula, =WRAPROWS.UNEVEN(C7:C25, "Item"), reshapes a stacked list into rows of uneven length.

The function body uses SCAN to carry each item label down to its attributes, then REDUCE and VSTACK to assemble one row per item:

=LET(
    list, C7:C25,
    delimiter, "item",
    item_scan, SCAN(
        0,
        IF(SEARCH(delimiter, list) = 1, list),
        LAMBDA(x, y, IF(IFERROR(y, "") = "", x, y))),
    stack_list, HSTACK(list, item_scan),
    filtered_list, FILTER(stack_list, NOT(ISNUMBER(SEARCH(delimiter, CHOOSECOLS(stack_list, 1))))),
    items, CHOOSECOLS(filtered_list, 2),
    unique_items, UNIQUE(items),
    attributes, CHOOSECOLS(filtered_list, 1),
    HSTACK(unique_items, DROP(REDUCE("", unique_items,
        LAMBDA(x, y, IFNA(VSTACK(x, TOROW(FILTER(attributes, items = y))), ""))), 1)))

Rotating 3D projections

A rotating 3D cube rendered on an Excel scatter chart. The cube is eight points; each frame multiplies them by a rotation matrix. For a rotation by θ\theta about the vertical axis, that matrix is

Ry(θ)=[cos⁡θ0sin⁡θ010−sin⁡θ0cos⁡θ],R_y(\theta) = \begin{bmatrix} \cos\theta & 0 & \sin\theta \\ 0 & 1 & 0 \\ -\sin\theta & 0 & \cos\theta \end{bmatrix},

It then projects the result onto the chart’s two dimensions. VBA advances the angle to animate the motion and adds interactivity.

Animated wireframe cube rotating on an Excel scatter chart.
Eight points, a rotation matrix, and a scatter chart: 3D graphics in a spreadsheet.

Monte Carlo simulations

Using Python in Excel, I simulated thousands of potential stock price paths to visualize volatility and the spread of possible outcomes over time, with the median path highlighted against the cloud of simulations.

Line chart titled Monte Carlo Simulation of Stock Prices with Median Highlighted: many faint colored price paths fanning out over 250 days, with a red median line.
Simulated price paths over roughly one trading year, with the median path in red.

Warehouse inventory heatmap

A live-updating heatmap of warehouse utilization by location, built for real-time decisions about space planning and stock movement. Every storage location on the floor plan is colored by how full it is. Search panels look up what is stored in a location (with its capacity and percentage full) or every location that holds a given part, and a running analysis lists empty and full locations.

Excel floor plan of warehouse storage locations shaded from yellow to red by utilization, with Location Search, Part Search, and Location Analysis panels on the right.
Floor plan, location search, part search, and empty/full analysis, all in one sheet.

Calendar heatmap

A GitHub-style calendar heatmap for tracking daily progress across a year, combining date logic with conditional formatting. The same layout supports different color scales for different kinds of data.

Three year-long calendar heatmaps in green, orange-and-green, and blue, with months across the top and weekdays down the side.
The same calendar grid with three different color scales.