public void MInverse() { IXLWorksheet ws = new XLWorkbook().AddWorksheet("Sheet1"); ws.Cell("A1").SetValue(1).CellRight().SetValue(2).CellRight().SetValue(1); ws.Cell("A2").SetValue(3).CellRight().SetValue(4).CellRight().SetValue(-1); ws.Cell("A3").SetValue(0).CellRight().SetValue(2).CellRight().SetValue(0); Object actual; ws.Cell("A5").FormulaA1 = "MInverse(A1:C3)"; actual = ws.Cell("A5").Value; Assert.IsTrue(XLHelper.AreEqual(0.25, (double)actual)); ws.Cell("A6").FormulaA1 = "Sum(A5)"; actual = ws.Cell("A6").Value; Assert.IsTrue(XLHelper.AreEqual(0.25, (double)actual)); ws.Cell("A7").FormulaA1 = "Sum(MInverse(A1:C3))"; actual = ws.Cell("A7").Value; Assert.IsTrue(XLHelper.AreEqual(0.5, (double)actual)); }
public void MDetem() { IXLWorksheet ws = new XLWorkbook().AddWorksheet("Sheet1"); ws.Cell("A1").SetValue(2).CellRight().SetValue(4); ws.Cell("A2").SetValue(3).CellRight().SetValue(5); Object actual; ws.Cell("A5").FormulaA1 = "MDeterm(A1:B2)"; actual = ws.Cell("A5").Value; Assert.IsTrue(XLHelper.AreEqual(-2.0, (double)actual)); ws.Cell("A6").FormulaA1 = "Sum(A5)"; actual = ws.Cell("A6").Value; Assert.IsTrue(XLHelper.AreEqual(-2.0, (double)actual)); ws.Cell("A7").FormulaA1 = "Sum(MDeterm(A1:B2))"; actual = ws.Cell("A7").Value; Assert.IsTrue(XLHelper.AreEqual(-2.0, (double)actual)); }
public void Yearfrac_2_base4() { Object actual = XLWorkbook.EvaluateExpr("Yearfrac(\"1/1/2008\", \"3/31/2013\",4)"); Assert.IsTrue(XLHelper.AreEqual(5.24722222222222, (double)actual)); }
public void Yearfrac_1_base3() { Object actual = XLWorkbook.EvaluateExpr("Yearfrac(\"1/1/2008\", \"3/31/2008\",3)"); Assert.IsTrue(XLHelper.AreEqual(0.24657534246575341, (double)actual)); }
public void Yearfrac_1_base1() { Object actual = XLWorkbook.EvaluateExpr("Yearfrac(\"1/1/2008\", \"3/31/2008\",1)"); Assert.IsTrue(XLHelper.AreEqual(0.24590163934426229, (double)actual)); }
public void TimeValue2() { Object actual = XLWorkbook.EvaluateExpr("TimeValue(\"22-Aug-2008 6:35 AM\")"); Assert.IsTrue(XLHelper.AreEqual(0.27430555555555558, (double)actual)); }
public void TimeValue1() { Object actual = XLWorkbook.EvaluateExpr("TimeValue(\"2:24 AM\")"); Assert.IsTrue(XLHelper.AreEqual(0.1, (double)actual)); }