You can use built-in formulas in cells. For a complete list of formulas, refer to the Formula Functions.
Column or row formulas automatically offset the cell references. If the formula in column A is "=B1", then the formula in A1 is "=B1", the formula in cell A2 is "=B2", and so on. Formulas in cells have higher precedence than formulas in columns or rows. Formulas are imported or exported to Excel-formatted files as individual cell formulas.
Column and row formulas are not supported in columns or rows that intersect with array formula ranges.
The following example uses the Formula property to add a built-in formula to a cell.
CS |
Copy Code |
---|---|
gcSpreadSheet1.Sheets[0].Cells[1, 1].Formula = "sum(A1:C1)"; |
VB.NET |
Copy Code |
---|---|
gcSpreadSheet1.Sheets(0).Cells(1, 1).Formula = "sum(A1:C1)" |