Multiplies the values in the field (column) of records in the database that match the conditions you specify.
Name | Type | Description |
arg1 | ApiRange | Is the range of cells that makes up the list or database. A database is a list of related data. |
arg2 | number | Is either the label of the column in double quotation marks or a number that represents the column's position in the list. |
arg3 | string | Is the range of cells that contains the conditions you specify. The range includes a column label and one cell below the label for a condition. |
builder.CreateFile("xlsx"); var oWorksheet = Api.GetActiveSheet(); var oFunction = Api.GetWorksheetFunction(); oWorksheet.GetRange("A1").SetValue("Product"); oWorksheet.GetRange("B1").SetValue("Identifier"); oWorksheet.GetRange("C1").SetValue("Value"); oWorksheet.GetRange("A2").SetValue("Apple"); oWorksheet.GetRange("B2").SetValue("Price"); oWorksheet.GetRange("C2").SetValue(25); oWorksheet.GetRange("A3").SetValue("Apple"); oWorksheet.GetRange("B3").SetValue("Quantity"); oWorksheet.GetRange("C3").SetValue(100); oWorksheet.GetRange("E1").SetValue("Product"); oWorksheet.GetRange("E2").SetValue("Apple"); var oRange1 = oWorksheet.GetRange("A1:C3"); var oRange2 = oWorksheet.GetRange("E1:F2"); oWorksheet.GetRange("E4").SetValue(oFunction.DPRODUCT(oRange1, "Value", oRange2)); builder.SaveFile("xlsx", "DPRODUCT.xlsx"); builder.CloseFile();