[Table of Contents] [docx version]
SpreadsheetML Reference Material - Table of Contents
A constant is a predefined value that is not calculated, and, therefore, does not change. A constant has the following form:
constant:
error-constant
logical-constant
numerical-constant
string-constant
array-constant
error-constant:
#DIV/0! | #N/A | #NAME? | #NULL! | #NUM! | #REF! | #VALUE!
numerical-constant:
whole-number-part [ . ] [ exponent-part ]
. fractional-part [ exponent-part ]
whole-number-part . fractional-part [ exponent-part ]
whole-number-part:
digit-sequence
fractional-part:
digit-sequence
exponent-part:
e [ sign ] digit-sequence
E [ sign ] digit-sequence
sign:
+
-
digit-sequence:
a series of one or more decimal digits
string-constant:
" [ string-chars ] "
string-chars
string-char
string-chars string-char
string-char
""
any character except "
To include a double-quote character (") in string-chars, precede it with another double-quote character. [Example: "ab""cd" contains the characters ab"cd, and """abcd""" contains the characters "abcd". end example]
An array constant is a list of one or more constants organized in one or two dimensions, and delimited by braces. An array constant has the following form:
array-constant:
{ constant-list-rows }
constant-list-rows:
constant-list-row
constant-list-rows ; constant-list-row
constant-list-row:
constant
constant-list-row , constant
An array-constant shall not contain
• An array-constant.
• Columns or rows of unequal length.
Any numerical-constant in an array-constant can be preceded immediately by a prefix-operator.
The constants in an array-constant can have different types.
[Guidance An implementation is encouraged to not unnecessarily limit the number of rows and columns in an array-constant. end guidance]
[Example: {1,3.5,TRUE,"Hello"} is a 1x4 array of constants.
To represent the values 10, 20, 30, and 40, as a 1x4 array, use {10,20,30,40}.
To represent the values 10, 20, 30, and 40 in the first row, and 50, 60, 70, and 80 in the second row, use the following 2x4 array constant: {10,20,30,40;50,60,70,80}. end example]
error-constant is described in §3.17.2.7.
Each constant has a corresponding type (§3.17.2.6), as follows:
Constant Form |
Type |
array-constant |
array |
error-constant |
error |
logical-constant |
logical |
numerical-constant |
number |
string-constant |
In the context of cell formulas and values in SpreadsheetML, the following definition of precision shall apply:
By default, default representation of precision shall be as defined by the XML schema double type http://www.w3.org/TR/xmlschema-2/#double. The default is therefore 53-bits of mantissa precision.
An application that uses XML schema double can optionally state the precision in the Additional Characteristics part by writing out the number of bits in the mantissa and exponent.
A compliant consumer shall parse numbers of arbitrary precision without error.