Text functions in Google Sheets allow you to manipulate and analyze text data efficiently. These functions are essential when working with names, codes, IDs, or any text-based information.
1. LEFT Function
The LEFT function extracts a specified number of characters from the beginning (left side) of a text string.
Syntax:=LEFT(text, number_of_characters)
Example:=LEFT(A2, 5) — Returns the first 5 characters from the value in cell A2
Use Cases:
Extract first names from full names
Get the first part of a product code
Pull area codes from phone numbers
2. RIGHT Function
The RIGHT function extracts a specified number of characters from the end (right side) of a text string.
Syntax:=RIGHT(text, number_of_characters)
Example:=RIGHT(B2, 4) — Returns the last 4 characters from the value in cell B2
Use Cases:
Extract last names from full names
Get the last digits of an ID number
Retrieve file extensions from filenames
3. MID Function
The MID function extracts characters from the middle of a text string, starting at a specified position.
Syntax:=MID(text, start_position, number_of_characters)
Example:=MID(C2, 3, 4) — Returns 4 characters starting from the 3rd character of C2
Use Cases:
Extract specific codes or segments from IDs
Pull substrings from long text
Retrieve part of a reference number
4. LEN Function
The LEN function returns the total number of characters in a text string, including spaces.
Syntax:=LEN(text)
Example:=LEN(D2) — Returns the total number of characters in D2
Use Cases:
Check length of passwords or codes
Validate data entries
Identify unusually long or short text strings
5. Benefits of Text Functions
Simplify extraction and manipulation of text data
Save time on manual editing
Prepare clean data for analysis
Enable advanced calculations and reporting
Conclusion
Text functions like LEFT, RIGHT, MID, and LEN are essential tools in Google Sheets for managing and analyzing textual data.
By mastering these functions, you can efficiently extract, validate, and manipulate text, making your spreadsheets more organized and insightful.