SpreadJS supports setting a formula in a specified cell, and you can also add a custom name for this formula.
Use code similar to the following to set a formula for a cell or a range of cells.
sheet.setFormula(1, 1, '=SUM(A1,C3)');
sheet.setArrayFormula(1, 1, 7, 7, '=SUM(A1,C3)');
You can get whether there is a formula in the specified cell by using the following code:
If a formula is lengthy or it is used frequently, you can add a custom name for it to make using it more convenient.
sheet.addCustomName('customName1','=SUM(A1,C3)', 1, 1);
A custom name can be removed from the custom name collection like this:
and you can remove all custom names by using the following method: