Skip to contentSheetwrite

Formulas

Type less, check more

Click the empty total and type = in the formula bar. The rest of the formula appears as ghost text, learned from the sheet's own formulas; Tab takes it.

Add-on @sheetwrite/formula-assist

Formulas to learn from
37
Empty cells to fill
3
Try it
  1. Selected: …
  2. See the suggestionType = in the formula barNo suggestion yet
  3. then EnterC14 is empty
  4. D8 is empty
Keystrokes saved: 0

A recorded session

A recorded session: totals, a share and a lookup typed in the formula barA recorded session: totals, a share and a lookup typed in the formula barA recorded session: totals, a share and a lookup typed in the formula barA recorded session: totals, a share and a lookup typed in the formula bar
A recorded session: totals, a share and a lookup typed in the formula bar

How it predicts

  • The formulas above and below the cell, or left and right of it, moved to it as a fill would move them. When both sides agree on one, the cell almost surely continues it; a formula only one side gives is not suggested.
  • When the typed letters match only one function or sheet name, that name, and the brackets that close calls with all their arguments.
  • A suggestion shows only when the benchmark measured it right at least 90% of the time, from the workbook alone: no network, no AI.

The code behind it

formula-assist.ts
import "@sheetwrite/core/styles.css";
import "@sheetwrite/core/shell.css";
import { createGrid, initSheetwrite, type Workbook } from "@sheetwrite/core";
import { createFormulaBar } from "@sheetwrite/core/shell";
import { formulaAssistAddon } from "@sheetwrite/formula-assist";
// A sheet with monthly figures in columns B to G and a total per row
declare const workbook: Workbook;
// Install once per page; grids created afterwards get suggestions in their formula bar.
// The grid fills its host, so the host needs a height
const host = document.querySelector<HTMLElement>("#grid");
if (host === null) throw new Error("Missing #grid host");
host.style.height = "480px";
const grid = createGrid(host, { workbook });
const bar = document.createElement("div");
host.before(bar);
// In the formula bar: type "=" under a column of =SUM(B2:G2), =SUM(B3:G3), …
// Tab takes the suggestion, Ctrl+→ one word of it (⌥→ on a Mac), and Esc hides
// it until you type.
// When the page removes the host: grid.destroy(); bar.remove();