SpreadJS Documentation > Sample Code > Sample Code for Formulas > Setting Formulas in Cells |
You can put formulas in cells.
This example sets formulas in cells.
JavaScript |
Copy Code
|
---|---|
window.onload = function () { activeSheet.getColumn(1) activeSheet.setValue(0, 0, 10); //Set SUM function (Sum of all parameter values). //Set PRODUCT function (Product of all parameter values). //Set AVERAGE function (Average of all parameter values). //Set the sum of cell(0,0) and cell(4,0). //Multiply cell(0,0) by 2 if the value in this cell is greater than 10, otherwise multiply it by 3. } |