Grist's PREVIOUS() function fixes running totals that break when you insert a row

Adding Window Functions to a Spreadsheet

Grist's PREVIOUS() function fixes running totals that break when you insert a row

In traditional spreadsheets, a running balance formula like =C3+B4 silently breaks when you insert a row: the reference shifts to the wrong cell and the total is wrong from that point on. Grist's PREVIOUS() function solves this by ordering records by a column you specify, not by their physical position. Insert or delete rows anywhere and balances recalculate correctly. The function also supports grouping, so each cardholder can have their own running total.

To a traditional spreadsheet, “the previous transaction” means “the cell above”. The two agree only as long as nobody rearranges anything.
  1. quaintdev

    Checkout ironcalc if you are looking for spreadsheet alternatives https://www.ironcalc.com/index.html

  2. heisenzombie

    Regarding adding higher level functions to spreadsheets in general. For people using Excel (at least, a modern-ish version that has LAMBDA), LLMs are shockingly good at writing LAMBDA functions. Especially if you have the “Advanced Formula Environment”, which lets you write whole modules of multi-line functions in text files.

    I’m personally allergic to ever using macros in Excel, and this is basically a better version of that for many (not all) purposes.

    For a stupid example, I had Opus write a bunch of linear algebra functions, including stuff like computing eigenvectors, culminating in a single function that computes rotation matrices for point-cloud best-fitting (ie the procrustes problem). Yes, I’m fully aware it’s sort of cursed to do that, yes it works, and yes normal people can use the resulting spreadsheet fine, they just magically have an ALIGN3D(frompoints, topoints) function.

  3. cluckindan

    Argh, the Claude-written text is painful to read.

  4. mallahan

    The way Excel formulas so easily break drove me to create https://www.treesum.app/.

  5. halo

    I sometimes feel the world is slowly reinventing BusinessObjects

More from this day

2026-11-04