The Excel LEFT function extracts a given number of characters from the left side of a supplied text string. For example, LEFT(“apple”,3) returns “app”.
Purpose
Extract text from the left of a string
Return value
One or more characters.
Syntax
=LEFT (text, [num_chars])
Arguments
- text – The text from which to extract characters.
- num_chars – [optional] The number of characters to extract, starting on the left side of text. Default = 1.
USES
The LEFT function extracts a given number of characters from the left side of a supplied text string. The second argument, called num_chars, controls the number of characters to extract. If num_chars is not provided, it defaults to 1. If num_chars is greater than the number of characters available, LEFT returns the entire text string.
Examples
To extract the first three characters of “January”:
=LEFT("January",3) // returns "Jan"
If the optional argument num_chars is not provided, it defaults to 1:
=LEFT("ABC") // returns "A"
If num_chars exceeds the string length, LEFT returns the entire string:
=LEFT("apple",100) // returns "apple"
When LEFT is used on a numeric value, the result is text:
=LEFT(1000,3) // returns "100" as text
The LEFT function is often combined with other functions like LEN and FIND to extract text in more complex formulas. For example, to split text at a specific character, use LEFT with the FIND function like this:
=LEFT(text,FIND(char,text)-1) // returns text to left of char