Formulas

The desktop, web and Server Editions use the same formula engine. A shared test set of 325 formulas checks that all three return the same results.

Formulas in the Web Edition

Syntax

Item Description
Start =SUM(A1:A3) (the leading = is optional)
Operators + - * / ^ & % = <> < > <= >= and parentheses. Precedence: comparison < & < + - < * / < ^ < % < sign
References A1, absolute $A$1, range A1:B3, whole column A:A, whole row 1:3, another sheet Data!A1, 'My sheet'!A1
Text "Passed" (double a quote to include it: "")
Booleans TRUE, FALSE
Dates Date cells stay dates; date + number = date (=A1+30)

Error values

Value Meaning
#DIV/0! Division by zero
#VALUE! Wrong value type
#REF! Refers to a deleted cell or a missing sheet
#NAME? Unknown function or name
#N/A Value not found
#NUM! Invalid number
#CIRC! Circular reference

Functions (129)

Category Functions
Sums and statistics SUM, AVERAGE, MIN, MAX, COUNT, COUNTA, COUNTBLANK, SUMIF, SUMIFS, COUNTIF, COUNTIFS, AVERAGEIF, AVERAGEIFS, MAXIFS, MINIFS, SUMPRODUCT, PRODUCT, MEDIAN, STDEV, STDEV.S, STDEV.P, STDEVP, VAR, VAR.S, VAR.P, VARP, LARGE, SMALL, RANK, RANK.EQ, SUBTOTAL
Math ROUND, ROUNDUP, ROUNDDOWN, TRUNC, INT, ABS, MOD, QUOTIENT, POWER, SQRT, EXP, LN, LOG, LOG10, PI, SIGN, CEILING, CEILING.MATH, FLOOR, FLOOR.MATH, EVEN, ODD, RAND, RANDBETWEEN
Logic and information IF, IFS, IFERROR, IFNA, SWITCH, AND, OR, XOR, NOT, TRUE, FALSE, NA, ISBLANK, ISNUMBER, ISTEXT, ISNONTEXT, ISLOGICAL, ISERROR, ISERR, ISNA, ISEVEN, ISODD, N
Text CONCATENATE, CONCAT, TEXTJOIN, LEFT, RIGHT, MID, LEN, UPPER, LOWER, PROPER, TRIM, SUBSTITUTE, REPLACE, FIND, SEARCH, REPT, EXACT, VALUE, TEXT, CHAR, UNICHAR, CODE, UNICODE, T
Date TODAY, NOW, DATE, TIME, YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, WEEKDAY, EDATE, EOMONTH, DAYS, DATEDIF, DATEVALUE, NETWORKDAYS
Lookup and reference VLOOKUP, HLOOKUP, XLOOKUP, MATCH, INDEX, CHOOSE, ROW, COLUMN, ROWS, COLUMNS
  • Criteria (COUNTIF, …): ">10", "<>Done", "Em*" (wildcards * ?; ~* is a literal *), numbers, empty text ""
  • SUBTOTAL(9, …) does not count other SUBTOTAL cells. Codes 101-111 also skip hidden, filtered and collapsed rows

Recalculation

  • When a value changes, the formulas that use it are recalculated the next time they are read. Results are cached until something changes again.
  • Very long reference chains (for example a running total over 50,000 cells) calculate without stack overflow.
  • TODAY, NOW and RAND are recalculated with Recalculate() (web: recalculate()).

When rows and columns change

Operation Effect on formulas
Insert rows/columns References below/right move; inserting inside a range grows the range
Delete rows/columns References to deleted cells become #REF!; ranges shrink
Sort Formulas move with their rows and relative references shift accordingly
Copy and paste Copying inside the grid shifts relative references (=A1*10 pasted three rows down becomes =A4*10)
Rename a sheet Sheet names in other sheets' formulas are updated
Undo Restores formulas changed by the operations above

Custom functions

' Arguments are calculated values. Ranges arrive as Object(,) 2-D arrays; empty cells are Nothing
NoxFormula.RegisterFunction("VAT", Function(args) Convert.ToDouble(args(0)) * 0.1)
NoxGrid1.SetFormula(0, 2, "=VAT(B1)")

Formulas that use custom functions are saved as values when exported to Excel (Excel does not have those functions).