Technology1 min read

Adding Window Functions to a Spreadsheet

By · Published by Everything Blog

In short

Conventional platforms like Google Sheets and Excel rely on rigid relative positions, meaning inserted or deleted rows frequently break running totals. Grist circumvents this by introducing tools like the PREVIOUS() formula, which sorts and monitors cumulative information via defined attributes like dates instead of physical cell coordinates. The update also lets users isolate calculations across custom groups, such as individual cardholder accounts, without writing complex queries.

Key points

  • Embedding calculation logic inside formulas allows spreadsheets to handle multiple indepe…: Embedding calculation logic inside formulas allows spreadsheets to handle multiple independent running totals side by side.
  • Segmenting data through grouping rules enables separate running balances for distinct cat…: Segmenting data through grouping rules enables separate running balances for distinct categories like cardholders within one table.
  • Attribute-based tracking resolves common reference errors and skipped calculations caused…: Attribute-based tracking resolves common reference errors and skipped calculations caused by standard position-dependent formulas.

Sources checked by our analysis pipeline: 1

Running totals, cumulative balances, and nearest matches: formulas between rows that stay correct.

Here is a formula many of us wrote early on. Put transactions in a traditional spreadsheet, like Excel or Google Sheets, one per row, and keep a running balance:

Copy the formula down, and it works. Each balance is the balance above it plus the amount on its own row.

Now you find a receipt from January 11 and insert a row for it, between rows 3 and 4. The new row has no formula, so you type one in, or copy it from above. But the balance below it now says =C3+B5

. When the rows shifted, the reference was adjusted to keep pointing at the same cell, and that cell is no longer the row above. The new transaction is skipped without showing an error of any kind. The balance is just wrong from that row on.

Delete a row instead, and the formula below it becomes #REF!

, and so does every balance after it.

None of this is a bug. To a traditional…

Technology