Constants

A constant is a predefined value that is not calculated, and, therefore, does not change. A constant has the following form:

constant:error-constantlogical-constantnumerical-constantstring-constantarray-constant

error-constant:#DIV/0! | #N/A | #NAME? | #NULL! | #NUM! | #REF! | #VALUE!

logical-constant:FALSETRUE

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-sequenceE [ sign ] digit-sequence

sign:+-

digit-sequence:a series of one or more decimal digits

string-constant:" [ string-chars ] "

string-charsstring-charstring-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".

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-rowconstant-list-rows ; constant-list-row

constant-list-row:constantconstant-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.

[GAn implementation is encouraged to not unnecessarily limit the number of rows and columns in an array-constant. ]

example:

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}. ]

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

text

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.