Export (0) Print
Expand All
Expand Minimize

FORMAT Function

Last modified: June 17, 2011

Applies to: Office 2013 | Visio 2013

In this article
Syntax
Remarks
Example 1
Example 2
Example 3

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

FORMAT(expression,"formatpicture")

Parameters

Name

Required/Optional

Data Type

Description

expression

Required

String

A combination of constants, operators, functions, and references to ShapeSheet cells that results in a value.

formatpicture

Required

String

The format picture used to fomat the string.

Return Value

String

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. For more information about specifying format pictures, see About format pictures.

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.

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

Returns "0.250 cm."

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

Returns "0.25 CM."

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

Returns "0.3 cm."

Show:
© 2014 Microsoft