calculate_formula method
calculate_formula
Calculates a formula.
Returns
Calculated formula result.
def calculate_formula(self, formula):
...
Parameter | Type | Description |
---|---|---|
formula | str | Formula to be calculated. |
calculate_formula
Calculates a formula expression directly.
Returns
Calculated result of given formula.
The returned object may be of possible types of Cell.value
, or ReferredArea.
def calculate_formula(self, formula, opts):
...
Parameter | Type | Description |
---|---|---|
formula | str | Formula to be calculated. |
opts | CalculationOptions | Options for calculating formula |
Remarks
The formula will be calculated just like it has been set to cell A1.
And the formula will be taken as normal formula.
If you need the formula be calculated as an array formula and to get an array for the calculated result,
please use Worksheet.calculate_array_formula
instead.
calculate_formula
Calculates all formulas in this worksheet.
def calculate_formula(self, options, recursive):
...
Parameter | Type | Description |
---|---|---|
options | CalculationOptions | Options for calculation |
recursive | bool | True means if the worksheet’ cells depend on the cells of other worksheets, the dependent cells in other worksheets will be calculated too. False means all the formulas in the worksheet have been calculated and the values are right. |
calculate_formula
Calculates a formula expression directly.
Returns
Calculated result of given formula.
The returned object may be of possible types of Cell.value
, or ReferredArea.
def calculate_formula(self, formula, p_opts, c_opts, base_cell_row, base_cell_column, calculation_data):
...
Parameter | Type | Description |
---|---|---|
formula | str | Formula to be calculated. |
p_opts | FormulaParseOptions | Options for parsing formula. |
c_opts | CalculationOptions | Options for calculating formula. |
base_cell_row | int | The row index of the base cell. |
base_cell_column | int | The column index of the base cell. |
calculation_data | CalculationData | The calculation data. It is used for the situation that user needs to calculate some static formulas when implementing custom calculation engine. For such kind of situation, user needs to specify it with the calculation data provided for AbstractCalculationEngine.calculate . |
Remarks
The formula will be calculated just like it has been set to the specified base cell.
And the formula will be taken as normal formula. If you need the formula be calculated as an array formula
and to get an array for the calculated result, please use
Worksheet.calculate_array_formula
instead.
See Also
- module
aspose.cells
- class
Worksheet