mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
Spreadsheet: Add sumProduct(If) functions
This commit is contained in:
parent
99425c5adc
commit
d2adf54e73
2 changed files with 90 additions and 0 deletions
|
@ -125,6 +125,16 @@ describe("Statistics", () => {
|
|||
expect(max(R`B0:B9`)).toEqual(81);
|
||||
});
|
||||
|
||||
test("sumProductIf", () => {
|
||||
expect(sumProductIf).toBeDefined();
|
||||
expect(sumProductIf((a, b) => b > 25, R`A0:A9`, R`B0:B9`)).toEqual(1800);
|
||||
});
|
||||
|
||||
test("sumProduct", () => {
|
||||
expect(sumProduct).toBeDefined();
|
||||
expect(sumProduct(R`A0:A9`, R`B0:B9`)).toEqual(2025);
|
||||
});
|
||||
|
||||
test("median", () => {
|
||||
expect(median).toBeDefined();
|
||||
expect(median(R`A0:A9`)).toEqual(4.5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue