12

When inspecting a cell element in XLSX file, I find the following formula element:

<f t="shared" si="0"/>

What is the meaning of such a formula element?

Chris
  • 8,527
  • 10
  • 34
  • 51
alancc
  • 487
  • 2
  • 24
  • 68

1 Answers1

14

ECMA-376 Part 1 Section 18.3.1.40 says:

The possible values for the t attribute are defined by the simple type ST_CellFormulaType, and are as follows:

...
shared (Shared formula)
...

Shared formula. If a cell contains the same formula as another cell, the "shared" value can be used for the t attribute and the si attribute can be used to refer to the cell containing the formula. Two formulas are considered to be the same when their respective representations in R1C1-reference notation, are the same.

Basically it is a space saving optimisation. One that is guaranteed to be a pain for anyone parsing/modifying the file.

jmcnamara
  • 38,196
  • 6
  • 90
  • 108
  • _"If a cell contains the same formula as another cell, the "shared" value can be used"_ is not completely true, [only certain kinds of formulas work](https://stackoverflow.com/q/54654993/1026). – Nickolay Mar 04 '21 at 08:22