Run Custom Calculation At Worksheet level

Can we run calculations for a specific custom formula at the Worksheet level?

Instead of going cell by cell, we want to target a specific type of formula and run a custom calculation at a Worksheet level.

How can that be achieved?

@aduttaPlanful,

Thanks for your query.

Although we are not entirely sure about your requierments but we think if you want to calculate only cells of one specific sheet, you can simply call the CalculateFormula() for the Worksheet class. Moreover, if you want to calculate one specific cell, you may find that cell at first and then call Cell.Calculate() for it.

Hi @Amjad_Sahi

Thanks for the quick response. We are already using the CalculateFormula() in our application. As per our understanding, this method entertains all sorts of formulas, be it a custom formula or be it a generic formula ex. =SUM()

Here we wanted to understand whether there is any API / Method which will only entertain a specific type of custom formula. So basically we don’t want to calculate all the formulas in a worksheet. Rather we only want to calculate a specific custom formula.

Please let us know about the same.

@aduttaPlanful,

There is no such an API to calculate specific custom formulas in the spreadsheet. For your case, you may get specific cells (cell by cell) which contain your custom formula (to be calculated) and call Calculate() method for the purpose.

Cool. Thanks for the info.

@aduttaPlanful,

You are welcome.