Formualizer Docs

CONVERT

Converts a numeric value from one supported unit to another.

Supports a focused set of length, mass, and temperature units.

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

=CONVERT(number, from_unit, to_unit)

Arguments

ArgumentTypeRequiredDefault
numberanyRequired—
from_unitanyRequired—
to_unitanyRequired—

Remarks

  • number is numerically coerced; unit arguments must be text.
  • Temperature conversions support C/cel, F/fah, and K/kel.

Error cases

  • Returns #N/A for unknown units or incompatible unit categories.

Examples

Convert kilometers to meters within the distance unit family.

Formula =CONVERT(2,"km","m")

Expected result 2000

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?.

Convert temperature units using an offset as well as a scale factor.

Formula =CONVERT(32,"F","C")

Expected result 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?.

A linear distance conversion preserves zero.

Formula =CONVERT(0,"m","km")

Expected result 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?.

Distance and time are incompatible unit families.

Formula =CONVERT(2,"m","s")

Expected result #N/A

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?.

Length conversion

Formula =CONVERT(1,"km","m")

Expected result 1000

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

When does CONVERT return #N/A?

Unknown unit tokens, non-text unit arguments, or mixing incompatible categories (for example length to mass) return #N/A.

Implementation

Engine source

On this page