CalculateFormula() calculating cell A1 when A1 is not referenced

Hello I have come across a couple of issues when running calculateFormula() and doing a direct calculation of a formula. calculateFormula is calculating cell A1 along with the actual calculation when a calculation options is passed with a custom calculation engine. If there is nothing inside cell A1 the program will throw an error and the formula will not be calculated.

There also seems to be an issue with how if statements are calculated in aspose if they are over a range as the following code worksheet.calculateFormula(=IF(ISERROR(D1:F1),“ISERROR”,D1:F1) ); will only return ISERROR if D1 (the first cell of the range) is an error and will return the range D1:F1 if D1 is not an error.

I have attached a simple console application that should showcase the issues I have been facing.
ConsoleApp1.zip (26.2 KB)

.

@ecarrillo,

Thanks for the sample files.

We noticed the issue(s) you mentioned after an initial test. We need to analyze the issue(s) in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CELLSNET-53317

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@ecarrillo,

When calculating a formula by CalculateFormula(string, CalculationOptions), the formula will be calculated just like it has been set to cell A1. However, of course it will never be set to the cell actually. So, for such kind of situation, if cell A1 has not been instantiated, you will get null for the property CalculationData.Cell in your custom engine. So please change your implementation of your custom engine to check whether this property is null, or use CellRow and CellColumn instead.

For the issue about calculating IFERROR, are you expecting the result as an array? If so, you need to call another method CalculateArrayFormula(string, CalculationOptions) instead, then the formula will be taken as an array formula in the calculation and you can get the expected result as array.