Back to Devexpress

How to: Use Constants and Calculation Operators in Formulas

officefileapi-12197-spreadsheet-document-api-examples-formulas-how-to-use-constants-and-calculation-operators-in-formulas.md

latest1.6 KB
Original Source

How to: Use Constants and Calculation Operators in Formulas

  • Sep 19, 2023

This example demonstrates how to create a simple formula using constants and calculation operators, and add this formula to a cell. Constants are values that are not calculated (e.g., date values, numbers, text strings). Operators specify what calculations should be performed on a formula’s elements.

View Example

csharp
// Use constants and calculation operators in a formula.
workbook.Worksheets[0].Cells["B2"].Formula = "= (1+5)*6";
vb
' Use constants and calculation operators in a formula.
workbook.Worksheets(0).Cells("B2").Formula = "= (1+5)*6"

See Also

Spreadsheet Formulas

Operators

How to: Use Cell and Worksheet References in Formulas

How to: Use Names in Formulas

How to: Use Functions and Nested Functions in Formulas