Skip to main content

Module functions

Module functions 

Source
Expand description

GridCraft worksheet function library.

Every function is described by a FnSpec (name, arity, category, which parameters take scalars, a signature and a one-line description) and implemented as a plain Rust function over already-evaluated arguments. The calculation engine looks functions up by name with lookup and invokes them through call, which applies Excel’s automatic array lifting: passing an array where a scalar is expected evaluates the function once per element.

Special forms that need references, laziness or hidden-row information (ROW, OFFSET, INDIRECT, LET, LAMBDA, SUBTOTAL, AGGREGATE, TEXT…) are evaluated by the host; this crate exports aggregate_values for SUBTOTAL/AGGREGATE.

Structs§

Arg
An evaluated argument. Ranges arrive as Value::Array (blank cells = Value::Empty) with from_ref = true.
FnSpec
Timeline
A timeline’s step, for continuing it past its last point (the Forecast Sheet’s future rows).

Enums§

Category

Traits§

Ctx
Services a function may need from the host.

Functions§

aggregate_values
Evaluates SUBTOTAL/AGGREGATE function function_num over already-filtered cell values.
aggregate_values_k
AGGREGATE codes 14 = LARGE, 15 = SMALL, 16 = PERCENTILE.INC, 17 = QUARTILE.INC, 18 = PERCENTILE.EXC, 19 = QUARTILE.EXC with their k argument; codes 1–13 delegate to aggregate_values.
all
Every registered function.
call
Calls a function with array lifting applied. Wrong arity gives #VALUE!.
lookup
Looks a function up by name (case-insensitive; _xlfn.- and _xlws.-free names). A _xludf. name is user-defined and never found.

Type Aliases§

FnImpl