Free Support Forum - aspose.com

Formula Cell

Hi, I have on cell whith a Formula. Sometimes the result of formula is #DIV/0?. I wanna that besides apear #DIV/0? apear other value like 0.

It´s possible??

Thank you!

Hi,

You may use the "IF" 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 project.

The problemn is, All values of my GridWeb will be calculate, and I I don´t know when the result is 0.

Hi,

Thanks for considering Aspose.

Well, we normally follow MS Excel standards and you know MS Excel will give you "#DIV/0!" error if it encounters a divison by zero calculations. I think you may scan throught all those formulas into the cells and try to border them with IF() condition.

Thank you.