Skip to content

Commit

Permalink
Add test for SUMIFS with multi-dimensional ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
igitur authored and jahav committed Apr 14, 2023
1 parent bb8d62d commit 9f36692
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ClosedXML.Tests/Excel/CalcEngine/MathTrigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,22 @@ public void SumIf_ReturnsCorrectValues_WhenFormulaBelongToSameRange()
}
}

[Test]
public void SumIfs_MultidimensionalRanges()
{
using var wb = new XLWorkbook();
var ws = wb.AddWorksheet();
ws.FirstCell().InsertData(new object[]
{
(10, 10, 1, 2),
(20, 15, 2, 4),
(30, 20, 3, 6),
(40, 25, 4, 8),
(50, 30, 5, 10),
});
Assert.AreEqual(30, ws.Evaluate("SUMIFS(C1:D5,A1:B5,\">20\")"));
}

/// <summary>
/// refers to Example 2 to SumIf from the Excel documentation.
/// As SumIfs should behave the same if called with three parameters, we can take that example here again.
Expand Down

0 comments on commit 9f36692

Please sign in to comment.