getFormula

returns the formula of a cell

string getFormula(string cell);

Parameters

cellstringthe id of a cell

Returns

stringthe formula of the cell

Example

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

Details

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

Back to top