Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Wed Apr 09, 2025 3:01 pm

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!
Attachments
files.zip
Contains the input file referenced by the sample code, and screenshots of the different results in Excel and Spire
(17.17 KiB) Downloaded 338 times

savvior.devs
 
Posts: 1
Joined: Tue Mar 03, 2020 3:43 pm

Thu Apr 10, 2025 1:43 am

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
User avatar

William.Zhang
 
Posts: 767
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.XLS