Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of t="shared" in a formula element?

Tags:

xlsx

openxml

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?

like image 820
alancc Avatar asked Aug 21 '13 15:08

alancc


1 Answers

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.

like image 183
jmcnamara Avatar answered Nov 04 '22 01:11

jmcnamara