This function is used to evaluate a text equation as an algebraic equation.
=EVALUATE(formula)
This function has the following argument:
Argument |
Description |
---|---|
formula |
Refers to a string that represents a formula or expression to be evaluated. This formula can reference cells or ranges in the worksheet. |
This function cannot be used directly in a cell, like SUM or AVERAGE functions. It must be used in the formula expressions applied to a custom-named range only. Therefore, if you use this function as "=EVALUATE(A1)", it throws an error. However, if you use the EVALUATE function as a custom name and then call the name from the target cell as "=EVALUATE("=A1+A2")", it returns the evaluated result of the cell range.
Returns the evaluated results.
The following example code uses the "EVALUATE(A1:A2)" function to create the named range "test," which evaluates the expressions present in cells "B1" and "B2" and displays the evaluated result in cell "C1".
// Adding EVALUATE Function IWorksheet TestActiveSheet = fpSpread1.AsWorkbook().ActiveSheet; fpSpread1.AsWorkbook().Names.Add("test", "EVALUATE(A1:A2)", null, 0, 1); TestActiveSheet.Cells["B1"].Value = "1+1"; TestActiveSheet.Cells["B2"].Value = "2+3"; TestActiveSheet.Cells["C1"].Formula2 = "test"; fpSpread1.SaveExcel("Book_EvaluateFunction.xlsm", ExcelSaveFlags.MacroEnabledWorkbook);
This function is available in product version 17.0 or later.