Skip to main content

ISFORMULA

Checks whether a reference to a cell contains a formula, and returns -true or -false.

Syntax

expression.ISFORMULA(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiNameA cell range to test. This argument can be a range or a range name.

Returns

boolean

Example

const worksheet = Api.GetActiveSheet();

// Set the formula in cell B3
worksheet.GetRange("B3").SetValue("=SUM(5, 6)");

// Check if there is a formula in C3
let func = Api.GetWorksheetFunction();
let result = func.ISFORMULA(worksheet.GetRange("B3"));
worksheet.GetRange("C3").SetValue(result);