Page 1 of 1

SpireXLS evaluating IFERROR function differently than Excel

PostPosted: Wed Apr 09, 2025 3:01 pm
by savvior.devs
Hello,

We are evaluating Spire.XLS for use on a project, however we ran across an issue where a formula appears to be calculated differently in Spire than it is in Excel. Essentially, on a formula such as this "=IFERROR(DATEVALUE(B1),DATEVALUE(B2))" when cell B1 is blank, Excel sees the first expression as an error and thus uses the value from B2. However, Spire doesn't see an error here and instead interprets DATEVALUE(B1), with B1 being blank, as the date 12/31/1899.

I created an example demonstrating this behavior. The input file is attached and the code below:

Code: Select all
using Spire.Xls;

Workbook wb = new Workbook();
wb.LoadFromFile("test.xlsx");
wb.CalculateAllValue();
Worksheet ws = wb.Worksheets[0];
string val = ws.Range[3, 2].FormulaValue.ToString();

Console.WriteLine(val);


This is in a console application using the latest version of Spire.XLS 15.4.0 targeting .NET 8.0.

Any assistance here is much appreciated!

Re: SpireXLS evaluating IFERROR function differently than Ex

PostPosted: Thu Apr 10, 2025 1:43 am
by William.Zhang
Hello,

Thanks for your inquiry.
I have reproduced your issue and logged it to our tracking system with ticket SPIREXLS-5778. Our development team will further investigate and fix it. I will notify you in time. Sorry for the inconvenience.

Sincerely,
William
E-iceblue support team