Skip to main content

SetFormulaArray

Sets an array formula to the current range.

Syntax​

expression.SetFormulaArray(data);

expression - A variable that represents an ApiRange class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
dataRequiredstring | boolean | numberThe general value for the cell or cell range.

Returns​

boolean

Example​

Apply an array formula to a range of cells in a spreadsheet.

// How do I fill multiple cells with a single shared formula in a spreadsheet?

// Enter one formula that automatically populates an entire block of cells in a spreadsheet.

let worksheet = Api.GetActiveSheet();
worksheet.GetRange("A1:C3").SetFormulaArray("={1,2,3}");