Number Base Spreadsheet

A grid calculator with a real formula engine: =A1+B2*2, =SUM(A1:B3), 16 functions, and real error cells for #DIV/0!, #CIRCULAR! and #NAME? instead of hanging.

Math & convertSpreadsheetFormulasMaths
Number Base Spreadsheet screenshot

A small grid calculator: type =A1+B2*2, =SUM(A1:B3) and function calls into cells and watch the values resolve. Circular references report #CIRCULAR!, division by zero reports #DIV/0! โ€” nothing hangs.

CLICK A CELL TO TYPE

How formulas work
  • Start a cell with = to make it a formula. A bare number is a constant.
  • Relative references: =A1+B2*2 — ^ is power, % is modulo.
  • Ranges: =SUM(A1:B3) or =AVERAGE(A1:D1).
  • Functions: SUM AVERAGE MIN MAX COUNT ABS ROUND FLOOR CEIL SQRT POW MOD INT SIGN, plus PI and E.
  • Comparisons work too: =A1>5 returns 1 (TRUE) or 0 (FALSE).
  • Divide by zero gives #DIV/0!, a cell that depends on itself gives #CIRCULAR!, an unknown name gives #NAME?, and anything malformed gives #VALUE!. Nothing hangs.
Formula parser

Every formula goes through a hand-written tokenizer and recursive-descent parser. There is no eval() anywhere, so a formula can only be an expression — it cannot reach into the page.

expr grammar expr := compare compare := add ( ( '=' | '<>' | '<=' | '>=' | '<' | '>' ) add )* add := mul ( ( '+' | '-' ) mul )* mul := unary ( ( '*' | '/' | '%' ) unary )* unary := ( '-' | '+' ) unary | power power := primary ( '^' unary )? primary := number | cell | range | NAME '(' args ')' | '(' expr ')' range := REF ':' REF args := arg ( ',' arg )*

More tools