[Table of Contents] [docx version]

SpreadsheetML Reference Material - Table of Contents

Scalar Formulas

A scalar formula shall be represented in a worksheet's XML by an f element that contains the text of the formula, and a v element that contains the text version of the last computed value for that formula. This pair of elements shall be inside a c element, which is, in turn, shall be inside a row element. [Example: Consider the scalar formula SQRT(C2^2+D2^2), where C2 refers to a cell containing the number 12.5, and D2 refers to a cell containing the number 9.6. The corresponding XML might be as follows:

<row r="2" spans="2:4">
<c r="B2" s="40">
<f>SQRT(C2^2+D2^2)</f>
<v>15.761027885261798</v>
</c>

<c r="C2" s="0">
<v>12.5</v>
</c>

<c r="D2" s="0">
<v>9.6</v>
</c>
</row>

In the scalar formula CONCATENATE("The total is ",C7," units"), C7 refers to a cell containing the number 23. The corresponding XML might be as follows:

<row r="7" spans="2:4" ht="285">
<c r="B7" s="4" t="str">
<f>CONCATENATE("The total is ",C7," units")</f>
<v>The total is 23 units</v>
</c>

<c r="C7" s="0">
<v>23</v>
</c>
</row>

As the function CONCATENATE returns a string, the value for the cell's t attribute is str.

end example]