We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Cells errors with CEILING function

I would like to highlight recent issues I have been having with Aspose handling of the CEILING function with significance parameter of 0.12.
A client supplied a hugely complex spreadsheet which produced incorrect results when run through Aspose Cells when compared to running directly in Excel. The spreadsheet is client confidential so cannot be supplied.

I would be grateful to receive any feedback on these observations., thank you

The workbook had many worksheets including 720 formula including CEILING function with significance parameter of 0.12,

i.e. =CEILING(F90-IF(Inputs!F$192=“No”,0,‘Pen Deb PRE DOL LR’!F322),0.12)

Results with CEILING(xxx,0.12)


I modified the SS to use CEILING(xxx,0.01) everywhere as an alternative. Results:


I also modified the SS to use MROUND(0.05999 + xxx,0.12) which should be mathematically more or less equivalent. Results:


As you can see the results with CEILING(xxx,0.12) are considerably different to those using MROUND(0.05999 + xxx,0.12) , which are very close to the results obtained when running the original spreadsheet directly in Excel.

(This is tested using Aspose Cells 22.5)


To evaluate your issue precisely, we need your template Excel file, sample (runnable) code and output results either in an output file(s) or get results dynamically at runtime to evaluate the differences when comparing with MS Excel calculated results. I have made this thread private so only you and Aspose staff members could see or download your attachments, no other user can do that. So, you may safely attach your attachments (you may zip the files prior attaching). If you still have reservations, you may fill some dummy data to be replaced in your spreadsheet and provide us. Alternatively, you may create a smaller version of the file and devise a separate template file containing the data and formulas accordingly.

I have attached a zip of the problem spreadsheet together with test c# code which can be used to call it.
The test shows a result of zero when running the test in Excel results in a number.
As an additional test I have attached a modified spreadsheet where the “CEILING(” function has been replaced by "MROUND(0.05999 + ", which should be mathematically equivalent. This returns the correct calculation result.

Test Ceiling Issue.zip (3.3 MB)


I could not execute your test case properly as I am not sure about some of the variables/objects and methods used in the code which are not resolved. It would be better if you could create and provide a standalone console application (complete source code without compilation errors) to reproduce the issue on our end, so we could evaluate your issue precisely to consequently figure it out soon.

By the way, I simply tested Aspose.Cells’ formula calculation engine regarding CEILING formula using your problematic spreadsheet (I used our latest version of Aspose Cells for .NET v22.5) with the following sample code and it works fine and as expected:
Sample code:

 var workbook = new Workbook("e:\\test2\\CeilingProblemSpreadsheet.xlsx");
            Worksheet worksheet = workbook.Worksheets["Late Ret"];
            Cell cell = worksheet.Cells["F443"];


Sorry I don’t know how to create console application for this.
The code was tested locally here on 22.5, and an earlier version 19.3 I think, with the same result.
The calculation relies upon inserting a long string of parameters into a specific cell, as set out in the test code, which then feeds through into the calculations.


See the document for your reference.

We do not entirely sure about for which specific range of cells and in which worksheet(s) you are updating data for the underlying cell having CEILING formula. So, if you cannot create and provide a sample simulation console application, at least, give us the definition code segments of the following objects and methods to know how you are creating those objects/methods:
AsposeWorkbook, AsposeWorkbook.Put(), AsposeWorkbook.Get(), etc.
After getting the above artifacts, we will be able to compile your code segment precisely to reproduce the issue.

Sorry I didn’t get a notification of your response.
To test the issue, programmatically write the long parameter string into the first sheet “Touch Inputs”, cell A1000, i.e.
workbook.Put( “1”, “1000”, “1”, parameter string…)
To check results, programmatically read from second sheet “Touch Outputs”, cell T59, i.e.
workbook.Get(“2”, “59”, “21”);

The parameter string to test with is:
“MR J TEST,13002557,10/03/2022,GHRQ,03/01/2021,R,61988,03/01/1959,WP102476C,03/01/2019,M,HGSU,YJ56,03/10/2029,Y,03/01/2021,11/09/1986,N,1073100.00,Early Retirement,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0,0,0,0,1083.28,125000.00,No,0,0,0,0,12742.69,265.47,796.42,5574.93,0,30529.37,0,0,0,0,0,0,0,0,0,No,0,0,150000,63713.32,0,47100.00,57000.00,58480.00,61880.00,61880.00,63880.00,65379.97,70040.97,70040.97,72114.68,73789.35,73789.35,01/04/2009,01/04/2010,01/04/2011,01/04/2012,01/04/2013,01/04/2014,01/04/2015,01/04/2016,01/04/2017,01/04/2018,01/04/2019,01/04/2020,50,No,0,0,0,0,0,0,0,0.00,0.00,03/10/2027,0,0,0.00,0.00,0,0,0,0,0,0,0,Staff,N,13043.02,63713.32,30585.30,13043.02,0,0,0,Male,JCSS,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,No,0,0,0,N,N,0,0,0,0,0,Y,N,0.00,0.00,0.00,0.00,0.00,0,Y,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0,0.00,0,0,Y,0.00,0.00,0,0,0,351.52,102.96,764.40,0.00,0.00,0.00,0.00,3542.08,516.48,5872.42,0.00,0.00,0.00,0.00,0.00,30529.37,0,0,0,0,0,0,-2.1 - -2.01,0,0,0,0,0,0,351.52,102.96,764.40,0.00,0.00,0.00,0.00,3542.08,516.48,5872.42,0.00,0.00,0.00,0.00,0.00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.00,47100.00,47100.00,57000.00,58480.00,61880.00,61880.00,63880.00,65379.97,70040.97,70040.97,72114.68,01/04/2007,01/04/2008,01/04/2009,01/04/2010,01/04/2011,01/04/2012,01/04/2013,01/04/2014,01/04/2015,01/04/2016,01/04/2017,01/04/2018,0,0,0,0,0,0,0,0,0,0,0,0,N,35090.00,16.0000,1.7,40000.00,20.0000,”


We are sorry but we still do not know about the definitions of the following APIs and methods:
AsposeWorkbook, AsposeWorkbook.Put(), AsposeWorkbook.Get(), etc.

It looks like you might have written some self hosting code snippets and using those custom methods with Aspose.Cells APIs. So, we need a working sample project to replicate the issue on our your end.

We again request you to create a standalone console application (complete source code without compilation errors) to reproduce the issue on our end, so we could evaluate your issue precisely and figure it out soon.

Sorry there was some wrapper code to handle converting string row/cols to numbers, but it’s fairly trivial stuff if you’ve ever used Aspose cells. I’m fairly certain this is a bug in your product I’m trying to show you.
var worksheet = workbook.Worksheets[worksheetNo];
var cell = worksheet.Cells[row, column]
cell.PutValue(value, true, true);

var worksheet = workbook.Worksheets[worksheetNo];
var cell = worksheet.Cells[row, column]
return cell.StringValue;


Thanks for providing further details.

I am able to reproduce the issue as you mentioned by using your template file and following sample code. I found an issue with with CEILING formula/function in Aspose.Cells’ formula calculation engine which gives incorrect results.
Sample code:

var workbook = new Workbook("e:\\test2\\CeilingProblemSpreadsheet.xlsx");
Worksheet worksheet = workbook.Worksheets["Touch Inputs"];
Cell cell = worksheet.Cells["A1000"]; 
cell.PutValue("MR J TEST,13002557,10/03/2022,GHRQ,03/01/2021,R,61988,03/01/1959,WP102476C,03/01/2019,M,HGSU,YJ56,03/10/2029,Y,03/01/2021,11/09/1986,N,1073100.00,Early Retirement,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0,0,0,0,1083.28,125000.00,,No,0,0,0,0,12742.69,265.47,796.42,5574.93,0,30529.37,0,0,0,0,0,0,0,0,0,No,0,0,150000,63713.32,0,47100.00,57000.00,58480.00,61880.00,61880.00,63880.00,65379.97,70040.97,70040.97,72114.68,73789.35,73789.35,01/04/2009,01/04/2010,01/04/2011,01/04/2012,01/04/2013,01/04/2014,01/04/2015,01/04/2016,01/04/2017,01/04/2018,01/04/2019,01/04/2020,,50,,,No,0,0,0,0,0,0,0,0.00,0.00,03/10/2027,0,0,0.00,0.00,0,0,0,0,0,0,0,Staff,N,13043.02,63713.32,30585.30,,,,,,,,,,,,,,,,,,,,,,,,,13043.02,0,0,0,,Male,,,,JCSS,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,No,0,,,,0,0,N,N,0,0,0,0,0,Y,N,0.00,0.00,0.00,0.00,0.00,0,,Y,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,,0,0.00,0,0,Y,0.00,0.00,,0,0,0,351.52,102.96,764.40,0.00,0.00,0.00,0.00,3542.08,516.48,5872.42,0.00,0.00,0.00,0.00,0.00,30529.37,0,0,,0,,0,0,0,-2.1 - -2.01,,,,0,0,0,0,0,0,351.52,102.96,764.40,0.00,0.00,0.00,0.00,3542.08,516.48,5872.42,0.00,0.00,0.00,0.00,0.00,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,,,,,0,0.00,47100.00,47100.00,57000.00,58480.00,61880.00,61880.00,63880.00,65379.97,70040.97,70040.97,72114.68,01/04/2007,01/04/2008,01/04/2009,01/04/2010,01/04/2011,01/04/2012,01/04/2013,01/04/2014,01/04/2015,01/04/2016,01/04/2017,01/04/2018,0,0,0,0,0,0,0,0,0,0,0,0,,,,,,,,,,,,,N,35090.00,16.0000,1.7,40000.00,20.0000,");

Cell cell2 = workbook.Worksheets["Touch Outputs"].Cells["U59"]; 
Console.WriteLine(cell2.Value);//0 - ok

Console.WriteLine(cell2.Value);//0 - Not ok, it should be 1549.08

I have logged a ticket with an id “CELLSNET-51186” for your issue. We will look into it soon.

Once we have an update on it, we will let you know here.

Thank you for looking into it Amjad. I look forward to hearing further from you.


You are welcome. And, sure, we will keep you posted with updates or resolution (once available) on it.