A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
← All posts
May 15, 2026 · Kyle Gwinnuptutorial

Spill functions: one formula, a whole column

One formula fans down a column. Walk through SAMPLE.* random draws, SEQ.* deterministic sequences, and column-wide arithmetic — the three kinds of spill in TukeySheets.

A spill function is one formula that fills many cells. You type it in a single cell, the anchor, and the result fans down the column below it. TukeySheets gives you three kinds: random draws (SAMPLE.*), deterministic sequences (SEQ.*), and arithmetic across whole columns (=A:A - B:B). All three behave the same way at the cell: one formula in, one column of values out.

This post covers what spills look like, how to redraw a stochastic spill with the resample button, and how to do math on spilled columns without writing per-row formulas.

Anatomy of a spill

A1: =SAMPLE.NORMAL(0, 1, 1000)

That formula lives in A1. A1 shows the first draw. The remaining 999 draws fill A2:A1000. The formula bar still reads =SAMPLE.NORMAL(0, 1, 1000) when you click any cell in the spill, because the formula owns the whole range. You don't see a thousand individual formulas in the formula store. You see one. The spilled cells are typed values that update together when the anchor is recomputed.

Two rules follow from that.

First, the cells below the anchor are not editable on their own. They belong to the spill. If you overwrite one, the spill breaks until you remove the override.

Second, if some other cell is already in the spill's destination range, the formula returns #SPILL! instead of writing over your data. You'll see the error at the anchor, and the cells below stay as they were.

Random spills with SAMPLE.*

The SAMPLE.* family covers the common distributions, continuous and discrete, behind a named formula.

=SAMPLE.NORMAL(0, 1, 1000)         standard-normal, 1000 draws
=SAMPLE.UNIFORM(0, 1, 500)         uniform on [0, 1], 500 draws
=SAMPLE.POISSON(3.2, 1000)         Poisson with mean 3.2
=SAMPLE.BINOMIAL(20, 0.3, 1000)    Binomial(n=20, p=0.3)

Each call spills n draws into the anchor column. Drop a histogram on the column and the shape is on the screen.

The resample button

Stochastic spills get a small play icon in the bottom-right of the anchor cell. Click it and the column redraws against the same arguments. The downstream cells, summary stats, plots, anything reading from the spill, recompute as a unit.

You use this when you want to see the variance of an estimator across many independent draws without retyping the formula or copying samples around. Sample once, look at the result, click play, look again.

Deterministic spills don't show the button. SEQ.LINEAR(0, 1, 101) will return the same 101 values every time, so a resample is a no-op. The button only appears on SAMPLE.* anchors.

Math on spills: spill-vectors

The third kind is the one you reach for most. Suppose you have two simulated columns:

A1: =SAMPLE.NORMAL(120000, 22000, 1000)   revenue draws, A1:A1000
B1: =SAMPLE.NORMAL(78000, 11000, 1000)    cost draws,    B1:B1000

You want profit, one value per row. The old answer was to fill C1: =A1-B1 and drag it down 1000 rows. That works, but it creates 1000 formulas, one per cell, which the engine has to track and recalculate individually.

In TukeySheets, you can write it as a single spill:

C1: =A:A - B:B

That is a spill-vector. One formula, one column of differences, no per-row tracking. The result spills the same way SAMPLE.* does, with one important difference: it has no resample button, because the formula is deterministic given its inputs. When A or B changes (a resample, an edit, a new column N), C recomputes automatically.

Prefer the spill-vector over the fill-down whenever you can. The two produce the same numbers, but the spill is faster. A fill-down of =A1-B1 over a thousand cells gives the engine a thousand formulas to track and recompute one at a time. A spill-vector gives it one. The gap is small at a hundred rows and matters at a million.

You can use bounded ranges too:

C1: =A1:A100 - B1:B100              fixed 100-row spill
C1: =A:A * 0.5                      half of column A
C1: =(A:A + 1) * B:B                nested arithmetic
C1: =-A:A                           unary negation

Whole-column refs (A:A) auto-size to the data in the column. Trailing blank rows are trimmed, so resizing the source columns resizes the result. If column A has a text header in row 1 and numbers below, TukeySheets detects that and skips the header from the read, so the result lines up with the data rows.

The grammar is small on purpose. It accepts arithmetic (+ - * / ^), unary minus, and percent, with leaves that are ranges, single cells, or numeric literals. Anything else (function calls, comparisons, text concatenation, two-dimensional ranges) falls back to scalar evaluation. A formula like =ABS(A:A) - B:B is not a spill-vector and will return #VALUE! if typed at a single cell, by design: function calls are evaluated at the leaf and TukeySheets doesn't yet vectorize them.

Putting them together

Spill functions compose by column. Here is the revenue, cost, and profit model in three cells:

A1: =SAMPLE.NORMAL(120000, 22000, 1000)
B1: =SAMPLE.NORMAL(78000, 11000, 1000)
C1: =A:A - B:B

A and B are stochastic, so each gets a resample button at its anchor. C is a spill-vector and tracks them. Click resample on A and the whole chain updates: A redraws, C recomputes, any histogram or =PERCENTILE(C:C, 0.05) you've laid down updates too.

Three formulas. A thousand simulated profits. No fill-down, no per-cell formulas, no script.

What spill functions are not

A spill function is not a function call you can nest. =SUM(SAMPLE.NORMAL(0, 1, 100)) does not work, because SAMPLE.NORMAL owns its anchor cell rather than returning a value to an enclosing expression. The pattern is: spill into a column, then operate on the column.

A spill-vector is not a fill-down replacement for arbitrary formulas. It only handles the array shapes listed above. For everything else (per-row IF, custom lookups, anything involving text), keep using fill-down.

Try it

Open TukeySheets, type any of the formulas in this post into A1, and press Enter. Click the play icon on a SAMPLE.* anchor to redraw. Type =A:A - B:B in C1 and watch it shrink and grow as you edit the source columns.

One formula, one column, one variable.