# Displaying Formula in Cells

Learn how to display and highlight formulas instead of calculated values in cells using Spread for WinForms. Find out how to enable or disable the display of cell formulas at the worksheet level.

## Content

Spread for WinForms allows you to display and highlight the formula in a cell instead of its final calculated value. The [DisplayFormulas](/spreadnet/api/latest/online-win/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IWorksheetView.DisplayFormulas.html) property in the [IWorksheetView](/spreadnet/api/latest/online-win/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.IWorksheetView.html) interface is used to enable or disable the display and highlight of cell formulas. By default, it is set to false. The **DisplayFormulas** property is set at the worksheet level. Hence, the other worksheets are not impacted by the value of any particular sheet.
When the **DisplayFormulas** property is set to true, then the cell’s formula is highlighted, and the column widths are also doubled to display the long formulas in cells conveniently. However, when set to false, the column widths are restored to their original width.

> !type=note
> **Note:**
>
> * This feature works when **LegacyBehaviors.Style** is excluded from [LegacyBehaviors](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.LegacyBehaviors.html) enum.
> * When the **DisplayFormulas** property is enabled, text overflow and auto merged cells are disabled.

The below image depicts the behavior of the **DisplayFormulas** property-
![](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/highlightformula.png)
The following code is used to display and highlight the formula in the active cell.

```csharp
IWorksheet sheet = fpSpread1.AsWorkbook().ActiveSheet;
// Displaying formula in cell
sheet.View.DisplayFormulas = true;
sheet.Cells["A1"].Value = 1;
sheet.Cells["B1"].Value = 1;
sheet.Cells["A2"].Formula = "SUM(A1,B1)";
sheet.Cells["A2"].Select();
```

```vbnet
Dim sheet As IWorksheet = FpSpread1.AsWorkbook().ActiveSheet
' Displaying formula in cell
sheet.View.DisplayFormulas = True
sheet.Cells("A1").Value = 1
sheet.Cells("B1").Value = 1
sheet.Cells("A2").Formula = "SUM(A1,B1)"
sheet.Cells("A2").[Select](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-displayingformulaIncells)
```

## Using Spread Designer

To enable the 'Show Formulas' option in Spread Designer, click on the 'Show Formulas' button from the Formulas tab. If the mode is already enabled, this button turns gray.
![Image displaying Show Formulas options in the Formulas tab of Spread Designer](https://cdn.mescius.io/document-site-files/images/2238e618-a1fb-45a6-9ce5-9a4157bd2931/images/formulabutton.png)

## See Also

[Formulas in Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula)
[Placing a Formula in Cells](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulaplace)
[Specifying a Cell Reference in a Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulacellref)
[Specifying a Sheet Reference in a Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulasheetref)
[Specifying an External Reference in a Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-externalref)
[Using a Circular Reference in a Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulacircref)
[Using DataTable Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/using-datatable-formula)
[Nesting Functions in a Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulanested)
[Recalculating and Updating Formulas Automatically](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formularecalc)
[Finding a Value Using GoalSeek](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formula-goalseek)
[Allowing the User to Enter Formulas](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulaallowuser)
[Creating and Using a Custom Name](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulacustomname)
[Creating and Using a Custom Function](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulacustomfunc)
[Creating and Using External Variable](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-external-variable)
[Using the Array Formula](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-arrayformula)
[Working With Dynamic Array Formulas](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/WorkingWithDynamicArrayFormulas)
[Working with the Formula Text Box](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-formulabar)
[Setting up the Name Box](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-namebox)
[Using Language Package](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/UsingLanguagePackage)
[Accessing Data from Header or Footer](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-headerfooterformula)
[Managing External Reference](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/spwin-extrenalreference)
[Auto Format Formulas](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/auto-format-formulas)
[Precedents and Dependents](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-cell-formula/precedents-dependents)