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

Free Support Forum - aspose.com

Aspose.Cells.CellsException: 'Invalid '"' .NET 22.3.0.0

I am trying to assign a valid Excel formula =IF(((I2/H2)>0.25)|I2/H2|"") that calculates a ratio between 2 cells and only displays the result if the ratio is greater than 0.25 otherwise the cell is assigned “” (display nothing).

I get an Aspose Cells exception. I’ve tried variations including assigning the Formula to a String variable, same results.

Aspose.Cells.CellsException: ‘Invalid ‘"’(Based on cell CSC!J2)’

image.png (122.8 KB)

@caremark
Please change your formulas: Cells[“J2”].Formula = “=IF(((I2/H2)>0.25),I2/H2,”")";

Syntax error with this format.

@caremark
The code should be as workbook.Worksheets[0].Cells[“J2”].Formula = “=IF(((I2/H2)>0.25),I2/H2,\”\")";
Please use comma as parameter separator。

Yes, great, thank you Simon! This works!

@caremark,

Good to know that your issue is sorted out by the suggested line of code. Feel free to write us back if you have further queries or issue, we will be happy to assist you soon.