Formualizer Docs

VALUETOTEXT

Converts a value to text representation.

VALUETOTEXT(value, [format]) supports concise (0) and strict (1) modes.

The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.

Syntax

=VALUETOTEXT(value, [format])

Arguments

ArgumentTypeRequiredDefault
valueanyRequired—
formatnumberOptional0

Return type

Can return text.

Remarks

  • Concise mode (0) returns natural text for scalars.
  • Strict mode (1) adds explicit quoting for text and serializes arrays with braces.
  • In concise mode, error values are propagated as errors.
  • In strict mode, error values are rendered as their error text.

Examples

Convert a number to its concise text form.

Formula =VALUETOTEXT(42)

Expected result 42

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Request strict output to see how a text value is represented.

Formula =VALUETOTEXT("Visit",1)

Expected result "Visit"

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Request the strict representation of empty text.

Formula =VALUETOTEXT("",1)

Expected result ""

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

In concise mode an input error propagates as an error value.

Formula =VALUETOTEXT(1/0)

Expected result #DIV/0!

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Concise text conversion

Formula =VALUETOTEXT(123)

Expected result 123

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

Strict quoting for text

Formula =VALUETOTEXT("hello", 1)

Expected result "hello"

Try this formula

This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.

FAQ

How are errors handled in concise vs strict mode?

Concise mode returns the error, while strict mode converts the error to its text form.

Implementation

Engine source

On this page