Formualizer Docs

LEFT

Returns the leftmost characters from a text value.

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

=LEFT(text, [num_chars])

Arguments

ArgumentTypeRequiredDefault
textanyRequired—
num_charsanyOptional—

Return type

Can return text.

Remarks

  • num_chars defaults to 1 when omitted.
  • If num_chars exceeds length, the full text is returned.
  • Non-text values are coerced to text before slicing.

Error cases

  • Negative num_chars returns #VALUE!.

Examples

Extract four ASCII characters from the selected end of a label.

Formula =LEFT("East-2024",4)

Expected result East

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

Omit the count and use the default of one.

Formula =LEFT("East-2024")

Expected result E

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 count of zero yields empty text.

Formula =LEFT("East-2024",0)

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

A negative extraction count is invalid.

Formula =LEFT("East-2024",-1)

Expected result #VALUE!

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

Take first two characters

Formula =LEFT("Formualizer", 2)

Expected result Fo

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

Default count is one

Formula =LEFT("Data")

Expected result D

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

What if num_chars is negative?

LEFT returns #VALUE! when num_chars is below zero.

Implementation

Engine source

On this page