Literals & operators
- Numbers, double-quoted strings.
- Booleans: bare
TRUEandFALSE(no parentheses).TRUE()still works. - Arithmetic:
+ - * /and power^(right-associative).3^2is 9.POWER(a,b)is the same idea. - Comparisons:
= <> < > <= >=. - Concat:
&.
Precedence (tight → loose): ^ → * / → + - → & → comparisons.
References
- Grid:
B4,$B$4, rangesA1:C10. - List: index name picks that item (value or nested structure).
- Table — two forms (important):
Total— the whole column (usable inSUM(Total), or as a list of values).Total.— the value on this row (trailing dot = same-row). Column formulas use this:=Q1.+Q2.
- Paths:
Budget.Total= the Total column of the Budget table. Quote a segment when it is not a bare ident, is all digits, looks like A1 (Q1), or contains a space or dot:'Line item','12','Q1'. Inside quotes,''is one apostrophe so a field namedfoo'baris'foo''bar'. Unquoted digits after a dive are always a 1-based record/item (Age.12), never a field named 12. - Into a structure (including formula results): path as deep as you need — each
.is another step.- Same-row nested fields: in a column formula,
Address.Citymeans “this row’s Address structure, then field City”. City must be a list index or nested table header — not a cell value from another column. - Cross-row by position:
Address.1.City— column as list indexed by 1-based row number only. First-column labels (e.g. “Amazon”) are never valid path segments. - If
Copyis=Budget, thenCopy.Notes.1.aworks the same (paths go through the formula cell, any depth). - Pointing: Space dives into formula results (and nested structures inside them); the inserted ref keeps the full path.
- Same-row nested fields: in a column formula,
- Formula tables:
TABLE(SEQUENCE(5), "Sq", LAMBDA(x, x*x))builds a whole table from a base list and calculated columns.ADDCOL(list, "Hdr", lambda)appends one column. AlsoTABLE(col1, col2, …)zips lists side by side.FIELDS(Budget)returns the field names of a table or dictionary as a list.RECORDS(Budget)is how many records (or list items) it has. Deleting or inserting a record rewrites positional path segments (Data.'5',Address.1.City) so they still point at the same record. - Filter / group:
FILTER(Orders, Orders.Region="West")keeps matching records (or list items).includeis a boolean list the same length as the source — typically an element-wise compare on a column. Empty match → empty table, not an error.GROUPBY(Orders, "Region", "Revenue", "SUM", "Units", "SUM")returns one row per group.SORT(Orders, "Revenue", FALSE)reorders records.UNIQUE(Orders, "Region")is the distinct values of a field;UNIQUE(Orders)is unique full records. Result tables are materialized values; the formula on the parent cell stays live. - Parent climb: leading dots only —
..Spend. Mid-path:Budget..Sibling. When the path goes all the way to the workbook root, the first name is the file name (Untitled.Spend), not a Sheet layer (Untitled.Sheet.Spend). - Defined names:
#spendjumps to a named cell.
^ is power. Climb with dots. Trailing . on a table field means same-row — not path climb. Path entry uses computed structures (stored nests and formula results).
Formulas never write. To append a record or copy values on purpose, use a slash command (/COPY, /SET, …) or a button.
Syntax
- Invalid formulas evaluate to
#SYNTAX(or a more specific error when possible). - Missing closing parentheses are fixed automatically:
=SUM(1+2becomes=SUM(1+2). Extra)is a real syntax error.
Functions
| Group | Functions |
|---|---|
| Aggregate | SUM, COUNT, COUNTA, AVERAGE/AVG, MIN, MAX, SUMIF/SUMIFS, COUNTIF/COUNTIFS, AVERAGEIF/AVERAGEIFS, MINIFS, MAXIFS, SUMPRODUCT |
| Stats | MEDIAN, STDEV, STDEVP, VAR, VARP, PERCENTILE, LARGE, SMALL, RANK, CORREL |
| Math | ABS, ROUND, INT, SQRT, POWER/POW, MOD, SIGN, CEILING, FLOOR, LOG, LN, EXP, PI, RAND, RANDBETWEEN |
| Logic | IF, IFS, SWITCH, IFERROR, IFNA, AND, OR, XOR, NOT, TRUE, FALSE |
| Lookup | XLOOKUP, VLOOKUP, INDEX, MATCH, CHOOSE, ROW, COLUMN |
| Lambda | LAMBDA, LET — inline LAMBDA(x, x*2)(5); store in a cell/name and call =f(a,b) or =#fn(3); LET(a, 2, a+a) |
| Array | SEQUENCE (virtual — O(1) memory; SUM(SEQUENCE(n)) is O(1)), TABLE (build tables from lists + LAMBDA columns), ADDCOL, FIELDS (list of field headers from a table or dictionary), RECORDS (record/item count of a table or list), FILTER (keep records/items where include is true), GROUPBY (one row per group with SUM/COUNT/AVERAGE/…), MAKEARRAY, RANDARRAY, MAP, BYROW, BYCOL, REDUCE, SCAN, UNIQUE (list or unique table records / field), SORT (list or table by field), TOCOL, TOROW, HSTACK, VSTACK, TAKE, DROP |
| Text | LEN, LEFT, RIGHT, MID, LOWER, UPPER, TRIM, CONCAT, TEXTJOIN, CHARSPLIT, COUNTCHAR, SUBSTITUTE, REPLACE, FIND, SEARCH, REPT, EXACT, TEXTBEFORE, TEXTAFTER, TEXTSPLIT |
| Info / convert | VALUE, N, ISBLANK, ISNUMBER, ISTEXT, ISLOGICAL, NA |
Aggregates flatten nested structures and columns. SUM(Budget.Total) and SUM(Total) (from inside that table’s parent or as a bare column) both sum the column’s computed values. A bare range without an aggregating function is #VALUE.
LAMBDA by reference
- Define in a cell:
=LAMBDA(x, y, x+y)— displays asλ(x, y). - Call from another cell via a list index / field / A1 / defined name:
=f(a,b),=A1(5),=#double(3). - Inline still works:
=LAMBDA(x, x*2)(5). - Only registered engine functions tokenize as
FUNC(. Anything else followed by(is a reference that must evaluate to a LAMBDA (else#NAME). - The engine stores a copy of the LAMBDA body tokens so the call site does not share the definition formula’s token stream (that mismatch used to surface as
#SYNTAX).
Lists & element-wise ops
Scalar functions and operators map over lists (and columns / 1D ranges) when they would otherwise take single values:
ABS(Data)→ a list the same size asData(each item absolute-valued). Index labels are kept.- Two list args of the same length zip pairwise:
Data^Data,Q1*Q2,POWER(A,B). - A scalar with a list broadcasts:
Data+1,Data^2,ROUND(Data, 0). - Different lengths →
#VALUE.
Aggregates (SUM, AVERAGE, …) still collapse to one number. Lookups (XLOOKUP, INDEX, …) keep their array semantics.
Errors
#SYNTAX · #CYCLE · #DIV/0 · #VALUE · #NAME · #NUM · #REF · #ERR.