Reference cells
Reference cells from JavaScript.
In Quadratic, reference individual cells from JavaScript for single values or reference a range of cells for multiple values.
Referencing individual cells
To reference an individual cell, use the global function cell
(or c
for short) which returns the cell value.
You can reference cells and use them directly.
Any time cells dependent on other cells update the dependent cell will also update. This means your code will execute in one cell if it is dependent on another. This is the behavior you want in almost all situations, including user inputs in the sheet that cause calculation in a JavaScript cell.
Referencing a range of cells
To reference a range of cells, use the global function cells
. This returns an array.
Referencing another sheet
To reference another sheet's cells or range of cells use the following:
Relative references
Reference cells relative to the cell you're currently in with relative cell references in JavaScript.
Get position of current cell
Keyword pos()
returns the current cell's position.
Reference values in relative cells
Reference the values of cells relative the current position.
Last updated