Skip to content

Formula References

Enable formula reference visualization to help users understand which cells are used in a formula.

<SpreadsheetViewer model={model} showFormulaReferencesOnCellSelection />

Set the showFormulaReferencesOnCellSelection prop to true to enable this feature.

When enabled, selecting a cell that contains a formula will automatically highlight all the cells referenced by that formula with colored dashed borders and semi-transparent fills.

The formula reference visualization provides:

  • Dashed borders around referenced cells
  • Semi-transparent fill colors for easy identification
  • Multiple colors to distinguish between different references in the same formula

Formula reference visualization is useful when:

  • Users need to understand formula dependencies
  • Building an educational spreadsheet tool
  • Debugging complex formulas
  • Providing a better user experience for formula editing

If you select a cell containing =SUM(A1:A5), cells A1 through A5 will be highlighted with a colored border and fill to show they are referenced by the selected formula.