Free Support Forum - aspose.com

IF() function fails to calculate for blank cells

It seems that the IF() function does not compute a value when the parameter refers to a blank cell.

For example, when A2 is blank, then the formula ‘=IF(A2,1,0)’ results in the famous invalid '#VALUE

Excel works fine with the above formula, it assumes that a blank cell equals to the FALSE condition.

Snippet to reproduce:

Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().getSheet(0);
sheet.getCells().getCell(“A1”).setFormula("=IF(A2,1,0)");
workbook.calculateFormula(false);
System.out.println(sheet.getCells().getCell(“A1”).getValue());

With kind regards,

Barry

Hi,

Thanks for the sample code.

After an initial test, I can find the issue, we will figure your issue out soon.

I have logged your issue into our issue tracking system with an id: CELLSJAVA-20063.

Thank you.

Hi,

Please try v2.4.0.6 downloading it from one of your threads to resolve the formulas issue.

http://www.aspose.com/community/forums/259245/value-a1-throws-exception-when-cell-is-null/showthread.aspx#259245

Thank you.

The issues you have found earlier (filed as 20063) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.