Hi, I have the following code tested against Aspose.Cells 24.2.0 (.NET), with the following TestCase13.xlsx workbook
TestCase13.zip (6.6 KB)
and I found that the ISERROR function doesn’t detect the NPER formula #NUM! error, returning FALSE when Excel returns TRUE.
var workbook = new Workbook("TestCase13.xlsx");
Worksheet worksheet = workbook.Worksheets["Sheet1"];
workbook.CalculateFormula();
Cell cell_C5 = worksheet.Cells["C5"]; // This cell has an NPER formula that evaluates to #NUM!
Cell cell_D5 = worksheet.Cells["D5"]; // This is =ISERROR(NPER(...)) the same NPER that evaluates to #NUM!
if (!cell_C5.IsErrorValue || cell_C5.DisplayStringValue != "#NUM!") // Passed
{
throw new ArgumentException("Should be #NUM! error.");
}
if (cell_D5.Type != CellValueType.IsBool || cell_D5.BoolValue != true) // Fail, cell_D5.BoolValue is false but should be true.
{
throw new ArgumentException("ISERROR of #NUM! result must be TRUE.");
}
In Excel cell D5 shows as TRUE, but the code above reads D5 as FALSE. Can you please have a look?
Thanks!