#2307·excelize

Add (*File).RecalcCell to persist a single formula cell's cached value

Author: krystophnyCreated Apr 23, 2026Updated Apr 27, 2026
Labelsenhancement

Description

Add a single-cell recalc entry point:

go
func (f *File) RecalcCell(sheet, cell string) error

It should evaluate the formula in the given cell with the existing recursive calc engine and write the typed result into the cell's cached <v>/<t> without touching <f>, the shared-formula master, ref span, or si index. Returns a sentinel error when the cell holds no formula.

Additional context

CalcCellValue today returns a formatted string but never writes it back. Every SetCell* writer strips <f> via removeFormula, so a caller cannot refresh the cached value while preserving the formula. Readers that honour <v> without recomputing (LibreOffice headless, Numbers, streaming parsers) therefore see stale results after any excelize round trip.

This issue is the granular version of the single-cell half of #2303. A follow-up issue will cover whole-workbook recalc built on top of this primitive.

Validations

  • Check that there isn't already an issue that requests the same feature to avoid creating a duplicate.