FORMAT function

Microsoft Office ShapeSheet

FORMAT function

Returns the result of expression as a string formatted according to format picture.

Syntax

FORMAT(expression,"formatpicture")

Remarks

The type of the expression and the type specified in the format picture govern the behavior of the returned string. The formatpicture must be appropriate for the type of expression.

Returns an error if the result of expression and the type expected in formatpicture are of a different kind or if there are syntax errors in formatpicture.

Example 1

FORMAT(1cm/4, "0.000 u")

Returns "0.250 cm."

Example 2

FORMAT(1cm/4, "0.00 U")

Returns "0.25 CM."

Example 3

FORMAT(1cm/4, "0.0 u")

Returns "0.3 cm."