Free Support Forum - aspose.com

Divide by Zero

Hi

How do I check if the cell I am about to divide by has Zero or no entry.

Regards

Bob Hamill

Hi,

Thanks for considering Aspose.

If you want to avoid the division by zero error (#DIV/0!), you may use the "IF" worksheet function. For an example: Cells[0,0].Formula = "=IF(B1<>0, B2/B1, 0)"; For more infomation about the Contition and Logical functions, please check the formula examples in the sample demo project.

And if you want to retrieve the value of a cell, you may use WebCell.Value property. This property returns the object value of the cell. The value type could be bool, DateTime, double, int, string.

Thank you.