# Nesting Functions in a Formula

Learn how you can nest a function within another function in a formula using Spread for ASP.NET.

## Content

You can nest a function within another function in a formula.
For more information about formulas, refer to the [Formula Reference](https://developer.mescius.com/spreadnet/docs/latest/online-formula/overview.html).

## Using Code

1. Specify the cell type.
2. Use a function within another function in a formula

## Example

In this example the sum of the value in two cells (found by using the SUM function) is embedded in a PRODUCT formula. First the cell types are set and the values of the cells are set.

```csharp
FarPoint.Web.Spread.DoubleCellType ncell = new FarPoint.Web.Spread.DoubleCellType();
FpSpread1.Sheets[0].Cells[0, 0, 2, 0].CellType = ncell;
FpSpread1.Sheets[0].Cells[0, 0, 2, 0].Value = 2;
FpSpread1.Sheets[0].Cells[3, 1].Formula = "PRODUCT(A1, SUM(A2,A3))";
```

```vbnet
Dim ncell As New FarPoint.Web.Spread.DoubleCellType
FpSpread1.Sheets(0).Cells(0, 0, 2, 0).CellType = ncell
FpSpread1.Sheets(0).Cells(0, 0, 2, 0).Value = 2
FpSpread1.Sheets(0).Cells(3, 1).Formula = "PRODUCT(A1, SUM(A2,A3))"
```

## See Also

[Formula Property](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.Cell.Formula.html)
[DoubleCellType Class](/spreadnet/api/latest/online-asp/FarPoint.Web.Spread/FarPoint.Web.Spread.DoubleCellType.html)