Headless Excel-compatible formula engine. Use Formula for one-shot stateless evaluation, or instantiate FormulaEngine for a stateful mini-spreadsheet that recalculates dependents on change. Formula syntax matches Excel — leading = optional. Supports the full function library registered with the engine plus operators, ranges (=SUM(A1:A10)), and built-in functions (SUM, AVERAGE, IF, VLOOKUP, …).
Object
Namespace: Radzen.Documents.Spreadsheet
Assembly: Radzen.Blazor.dll
public sealed class FormulaEngineCreates a new engine with an internal worksheet sized to Excel's limits (1,048,576 rows × 16,384 columns).
public FormulaEngine()The function registry. Use Functions.Add<YourFormulaFunction>() to extend the formula library with custom functions.
public Documents.Spreadsheet.FunctionStore Functions { get; }
| Type | Description |
|---|---|
| Documents.Spreadsheet.FunctionStore | The function registry. Use Functions.Add<YourFormulaFunction>() to extend the formula library with custom functions. |
Evaluates an ad-hoc expression against the current engine state, returning the result without writing to any cell.
public object Evaluate(string expression)
| Type | Name | Description |
|---|---|---|
| string | expression |
| Type | Description |
|---|---|
| object |
Reads a cell's current value. For formula cells, returns the cached evaluated result.
public object Get(string cellRef)
| Type | Name | Description |
|---|---|---|
| string | cellRef |
| Type | Description |
|---|---|
| object |
Sets a cell's value or formula. A string starting with = is treated as a formula; everything else is parsed as a literal (numbers, dates, booleans, text). Dependent formulas already in the engine recalculate automatically.
public void Set(string cellRef, object value)
| Type | Name | Description |
|---|---|---|
| string | cellRef | |
| object | value |