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.

VALUE(A1) throws Exception when cell is null - #8 by amjad.sahi - Free Support Forum - aspose.com

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.