Hi,
I have an Excel workbook that uses the NPER function but it causes a #DIV/0! division by zero error in Microsoft Excel.
Here is an example workbook: TestCase08.zip (6.6 KB)
However, if I use Apose.Cells .NET version 22.3.0 to open the workbook and call CalculateFormula, Aspose changes the error from #DIV/0! to #NUM! a number error. For example:
var workbook = new Workbook("TestCase08.xlsx");
Worksheet worksheet = workbook.Worksheets["Sheet1"];
string s1 = worksheet.Cells["A3"].ToString();
workbook.CalculateFormula(); // Calculate formula.
string s2 = worksheet.Cells["A3"].ToString();
The value of s1
is Aspose.Cells.Cell [ A3; ValueType : IsError; Value : #DIV/0!; Formula=NPER(C3/12,D3,-E3,0,0) ]
The value of s2
is Aspose.Cells.Cell [ A3; ValueType : IsError; Value : #NUM!; Formula=NPER(C3/12,D3,-E3,0,0) ]
It seems Aspose.Cells did recognise the original error as a division by zero. I’m just wondering why the error type changed from #DIV/0! (matching what Microsoft Excel shows) into #NUM!? I feel it will be better if the error type did not change and just stay the same as what Excel shows.
Thanks for looking into this question.