The LEFT function in Google Sheets is a powerful tool for manipulating text. It allows users to extract a substring from the beginning of a specified string, making it particularly useful for tasks such as data cleaning and formatting. This function is essential for users who need to retrieve specific portions of text efficiently.
Syntax
LEFT(text, [num_chars])
- text: The original string from which you want to extract the substring.
- num_chars: The number of characters you wish to extract from the start of the string. This parameter is optional; if omitted, the default is 1.
Example #1
=LEFT("Hello World", 5)
This function extracts the first 5 characters from the string “Hello World”, resulting in “Hello”.
Example #2
=LEFT("Spreadsheet", 3)
This function takes the first 3 characters from the string “Spreadsheet”, returning “Spr”.
Example #3
=LEFT("Data Analysis")
This function, using just the text parameter, extracts the first character from the string “Data Analysis”, resulting in “D”.
Error handling
- VALUE!: This error occurs if num_chars is less than 0, as it is not possible to extract a negative number of characters.
- REF!: This error is returned if the text argument is a reference that is not valid.