Skip to main content

LEFT

The LEFT function returns the given number of characters from the beginning of a string.

This function is useful when you need to retrieve a specific number of characters from a text value.

Syntax​

LEFT(string, [num_characters])

ArgumentDescriptionPermitted values
stringText from which the left fragment is returnedText string or reference to a cell containing text
[num_characters](optional) Number of characters to return from the left side of the string. By default, 1Positive integer or a reference to a cell with a number

Examples of use​

Retrieving the first 5 characters from a string:

=LEFT("Hello, world!", 5)

This formula will return "Hello".

If the number of characters is not specified, the function will return 1 character by default:

=LEFT("Test")

This formula will return T.

If the number of characters exceeds the length of the string, the function will return the entire string:

=LEFT("Code", 20)

This formula will return "Code".

Notes​

  • The LEFT function takes into account all characters, including spaces and special characters.
  • If the num_characters argument is less than or equal to 0, the function will return an empty string.