Skip to main content


returns the formula of a cell

getFormula: (cell: string) => string | string[];


cell: string - the id of a cell


The formula of the cell.


var formula = spreadsheet.getFormula("B2");
// -> "ABS(C2)"

The reference to a cell can be specified in the following format:

var formula = spreadsheet.getFormula("sheet1!B2"); // -> "ABS(C2)"

where sheet1 is the name of the tab.

In case the name of the tab isn't specified, the method will return the formula of the cell from the active tab.

Change log:

added in v4.1