Using IF condition when using aspose with Dynamic formula

Hi Team

We are calculating cell value by applying dynamic formula(a-b/b) using smart markers in the template. If the denominator value is zero then we are facing divided by zero error. How could we apply conditioned based dynamic formula with smart markers in the template.

Please let us know if anyone has an idea on the same. It would be of great help.

Dynamic formula is not being evaluated when added in IF condition i.e &=&=IF(B{r}>0,(A{r}-B{r})/B{r}),0).

Regards

Anitha

Hi,


I think you may try to change your dynamic formula to:

&=&=IF(B{r}>0,(A{r}-B{r})/B{r},0)

Let us know if your still find any issue with dynamic formula evaluation.

Thank you.

Hi,

Thank you very much for the response. I corrected the formula by removing extra brace and still facing same issue. For reference i am adding "Input Template" and generated "Output Excel" files.

In "Output Excel" please refer to F16 for divided by zero error. On highlighting that cell the formula is visible in formula bar for refrence.And dynamically its not populated for F17 and so on.

Please help me out where i am going wrong. Let me know if more inputs are required.

Thanking you in advance.

Regards

Anitha

Hi,


Thanks for the sample files.

Well, I have checked your template file and output file. The behavior is expected and correct. The reason is simple, your underlying data is in string and not numeric data, so your are getting “#DIV/0!” error for those dynamic formulas, you got to fill your data table with numeric values instead of strings, then it will work fine.

Thank you.

Hi,

Thank you. Its working fine for numeric values. But dynamic formula is not working for next rows. Only in one row formula is working and data is populated. Is there any isssue in my template.

Regards

Anitha

Hi,

Anitha Devi:

...But dynamic formula is not working for next rows. Only in one row formula is working and data is populated. Is there any isssue in my template.


Could you create a sample JAVA program (runnable) and post us here to reproduce the issue on our end, we will check it soon.


Thank you.