SUBTOTAL
function SUBTOTAL(): number | string | boolean
Description
Returns a subtotal in a list or database.
Returns
number | string | boolean
Try It
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.SUBTOTAL(9, 10, 30, 50, 5));