Formula evaluation
Formula evaluation in Spreadsheet 2 with support for client-side calculation, Excel/Google Sheets compatibility, and custom functions.
Calculation Modes
1. Main Thread Calculation (Default)
import { useSpreadsheetState } from '@rowsncolumns/spreadsheet-state';
const MySpreadsheet = () => {
const state = useSpreadsheetState({
calculationMode: 'single', // Default
initialSheets: [
{
id: 1,
name: 'Sheet1',
cells: [
{ rowIndex: 1, columnIndex: 1, formattedValue: '5' },
{ rowIndex: 1, columnIndex: 2, userEnteredValue: '=A1*2' }
]
}
]
});
return (
<CanvasGrid
{...state}
rowCount={1000}
columnCount={26}
/>
);
};2. Web Worker Calculation
Excel/Google Sheets Compatibility
Supported Features
Formula Errors
Error
Description
Example
Array Formulas
Circular References
Named Ranges
Structured References (Excel Tables)
Supported Functions
Custom Functions
Defining Custom Functions
Registering Custom Functions
Function Autocomplete
Performance Optimization
Tips for Large Workbooks
Benchmarks
Operation
Dataset
Time
Troubleshooting
Formulas Not Updating
#REF! Errors
Slow Performance
Custom Functions Not Working
Package Information
Installation
Further Reading
Support
Last updated