What does the "s" attribute signify in a cell tag in XLSX

chugadie picture chugadie · Jul 1, 2010 · Viewed 15.3k times · Source

In the XML of a worksheet in an XLSX file (Excel 2007) cell tags that have a "t" attribute equal to "s" are string types. The value tag inside the c needs to be looked up and converted via the sharedStrings document. But, some cells have s="237" and no t attribute at all. The value tag has an integer like 39448 which does not relate to the sharedStrings document. The value as it appears in Excel is a date 1/1/2008.

What does the s attribute signify in a c tag in XLSX?

Unknown value

<c r="B47" s="237">
    <v>39448</v>
</c>

Shared String value

<c r="C47" t="s">
    <v>7</v>
</c>

Answer

mscccc picture mscccc · Jul 14, 2010

The s attribute refers to a style. "237" is a style defined in the styles.xml file.

<v>39448</v>

...is most likely a date in double format. And the style 237 tells excel to display 39448 in date format.

You can see an example of how this works here: http://blogs.msdn.com/b/brian_jones/archive/2007/05/29/simple-spreadsheetml-file-part-3-formatting.aspx