These functions are mainly used to extract and count characters.
LEFT
Purpose
Extracts characters from the beginning of a text string.
Syntax
=LEFT(text,[num_chars])
Example
A2:
CUST-00125
Formula:
=LEFT(A2,4)
Result:
CUST
RIGHT
Purpose
Extracts characters from the end of a text string.
Syntax
=RIGHT(text,[num_chars])
Formula:
=RIGHT(A2,5)
Result:
00125
MID
Purpose
Extracts characters from a specific position.
Syntax
=MID(text,start_num,num_chars)
Example:
EMP-2026-001
Formula:
=MID(A2,5,4)
Result:
2026
LEN
Purpose
Counts the number of characters in a text string, including spaces.
Syntax
=LEN(text)
Example:
Microsoft Excel
Formula:
=LEN(A2)
Result:
15
Practice
Create a Product Code Analysis sheet and extract:
- Prefix
- Year
- Product number
Total characters