Back to Devexpress

How to: Add Formulas to Cells

wpf-16339-controls-and-libraries-spreadsheet-examples-cells-how-to-add-formulas-to-cells.md

latest967 B
Original Source

How to: Add Formulas to Cells

  • Jun 07, 2019

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"