Aspose::Cells::Cell::SetFormula method

Cell::SetFormula(const U16String&) method

Gets or sets a formula of the Cell.

void Aspose::Cells::Cell::SetFormula(const U16String &value)

Remarks

A formula string always begins with an equal sign (=). And please always use comma(,) as parameters delimiter, such as “=SUM(A1, E1, H2)”.

Examples

Aspose::Cells::Startup();
Workbook excel;
Cells cells = excel.GetWorksheets().Get(0).GetCells();
U16String f = u"=SUM(B2:B5, E1) + sheet1!A1";
cells.Get(u"B6").SetFormula(f);
Aspose::Cells::Cleanup();

See Also

Cell::SetFormula(const char16_t*) method

Gets or sets a formula of the Cell.

void Aspose::Cells::Cell::SetFormula(const char16_t *value)

Remarks

A formula string always begins with an equal sign (=). And please always use comma(,) as parameters delimiter, such as “=SUM(A1, E1, H2)”.

Examples

Aspose::Cells::Startup();
Workbook excel;
Cells cells = excel.GetWorksheets().Get(0).GetCells();
cells.Get(u"B6").SetFormula(u"=SUM(B2:B5, E1) + sheet1!A1");
Aspose::Cells::Cleanup();

See Also

Cell::SetFormula(const U16String&, const Aspose::Cells::Object&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const U16String &formula, const Aspose::Cells::Object &value)
ParameterTypeDescription
formulaconst U16String&The formula.
valueconst Aspose::Cells::Object&The value(calculated result) of the formula.

See Also

Cell::SetFormula(const char16_t*, const Aspose::Cells::Object&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const char16_t *formula, const Aspose::Cells::Object &value)
ParameterTypeDescription
formulaconst char16_t*The formula.
valueconst Aspose::Cells::Object&The value(calculated result) of the formula.

See Also

Cell::SetFormula(const U16String&, const FormulaParseOptions&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const U16String &formula, const FormulaParseOptions &options)
ParameterTypeDescription
formulaconst U16String&The formula.
optionsconst FormulaParseOptions&Options for parsing the formula.

See Also

Cell::SetFormula(const char16_t*, const FormulaParseOptions&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const char16_t *formula, const FormulaParseOptions &options)
ParameterTypeDescription
formulaconst char16_t*The formula.
optionsconst FormulaParseOptions&Options for parsing the formula.

See Also

Cell::SetFormula(const U16String&, const FormulaParseOptions&, const Aspose::Cells::Object&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const U16String &formula, const FormulaParseOptions &options, const Aspose::Cells::Object &value)
ParameterTypeDescription
formulaconst U16String&The formula.
optionsconst FormulaParseOptions&Options for parsing the formula.
valueconst Aspose::Cells::Object&The value(calculated result) of the formula.

See Also

Cell::SetFormula(const char16_t*, const FormulaParseOptions&, const Aspose::Cells::Object&) method

Set the formula and the value(calculated result) of the formula.

void Aspose::Cells::Cell::SetFormula(const char16_t *formula, const FormulaParseOptions &options, const Aspose::Cells::Object &value)
ParameterTypeDescription
formulaconst char16_t*The formula.
optionsconst FormulaParseOptions&Options for parsing the formula.
valueconst Aspose::Cells::Object&The value(calculated result) of the formula.

See Also