To create this formula, you can use the SUMIFS function in Excel. In TypeScript, you can write the formula as follows:
index.ts237 chars10 lines
In this function, values
is a 2D array representing the spreadsheet data. The function loops through each row of the data, and adds the value in column B to the sum
variable if the corresponding row has a value of "dividend" in column C and "xyz" in column E.
This function can be called with a 2D array of spreadsheet data, like so:
index.ts308 chars12 lines
In this example, the formula should return a value of 30, since the sum of the values in column B where column C is "dividend" and column E is "xyz" is equal to 10 + 15 + 5 = 30.
gistlibby LogSnag