What is the LEFT function?
=LEFT(text, [num_chars])LEFT returns the first characters of a text: a prefix of a product code, the area code of a phone number, the city in "Seattle, WA".
Spaces and punctuation count as characters. If num_chars is larger than the text, LEFT returns the whole text.
Arguments
- text
- The text, or a cell containing it.
- num_chars
- How many characters to return. If omitted, LEFT returns 1 character.
LEFT examples
Example 1. City from "Seattle, WA"
=LEFT("Seattle, WA", 7)The result is Seattle.
Example 2. Everything before a comma
=LEFT(A2, FIND(",", A2)-1)FIND returns the position of the comma, so LEFT takes everything before it, whatever the length.
Common mistakes
Numbers come back as text
LEFT always returns text. =LEFT(2026, 2) is the text "20". Wrap it in VALUE if you need a number.
Hidden leading spaces
A leading space is the first character. Clean the text with TRIM first.
FAQ
- How do I take characters from the end?
- Use RIGHT. For the middle, use MID.