Your formulas. Your rules.

Write Lua functions, call them like built-ins.

Sandboxed. Deterministic. Verifiable.

Custom logic inside the sandbox — not an escape hatch from it.

If it runs, it runs the same way every time.

The problem with custom code in spreadsheets

Most spreadsheet "custom code" is stateful, side-effectful, and impossible to verify.

VBA macros read the clock. Python add-ins call APIs. Excel lambdas compose, but can't enforce purity.

Once you allow time, randomness, or I/O, reproducibility is dead. The output depends on when you ran it, not what you ran.

Custom code in spreadsheets is where auditability goes to die.

VisiGrid takes a different approach: your code runs inside the same deterministic sandbox as everything else.

Write Lua, call in formulas

=ACCRUED_INTEREST(B6, C6, D6) works like any built-in. No macros. No add-ins. No special mode.

Define a function in Lua. VisiGrid registers it alongside the 181 built-in functions. It appears in autocomplete, works in formulas, and evaluates during recalculation.

One file. One language. Functions available in every sheet.

Sandboxed by default

No global mutation. No randomness. No I/O. Hard instruction limits.

Custom functions run in a Lua sandbox with the same constraints as built-in functions: pure input, pure output, no side effects.

If it runs, it runs the same way every time. That's not a limitation — it's the entire point.

What travels with the workbook

functions.lua lives on your machine, in ~/.config/visigrid/, not inside the workbook. Someone who opens your file without it sees the values you last saved, and Unknown function if a cell recalculates.

The workbook fingerprint covers inputs and formulas. It records that a cell calls =ACCRUED_INTEREST(…), not what the function does, so changing functions.lua does not change it. If two people must agree on a result, they must agree on functions.lua too.

When the logic has to travel with the file, put it in the cell: =LUA("…", B2, C2) keeps its code in the formula, runs in the same sandbox, and is saved with the workbook and covered by its fingerprint.

When it matters

Finance

Accrual calculations, day-count conventions, custom pricing models — written once, in one readable place.

Compliance

Domain rules a reviewer can read line by line, instead of a nested formula copied down a column.

Domain-specific calculations

Engineering formulas, scientific models, industry-standard computations.

Logic that travels

Put a rule in an <code class="font-mono">=LUA</code> cell and it goes wherever the workbook goes, covered by its fingerprint.

Try it in 60 seconds

Three steps. No setup beyond the app itself.

1

Create the functions file

Terminal
$ mkdir -p ~/.config/visigrid
$ $EDITOR ~/.config/visigrid/functions.lua
2

Paste a function

~/.config/visigrid/functions.lua
-- Accrued interest (actual/365)
function ACCRUED_INTEREST(principal, rate, days)
  return principal * rate * days / 365
end
3

Use it in a formula

Open VisiGrid. Type =ACCRUED_INTEREST(1000000, 0.0425, 92) in any cell. It evaluates like a built-in.

It also runs headless: vgrid loads the same functions.lua. The file stays on your machine, so to send a rule along with a workbook, use an =LUA cell.

Build your own formulas

Custom functions are included in VisiGrid Free. Write Lua, call it in formulas.