LEFT, RIGHT, MID and LEN
Pull characters out of text and count them.
LEFT(text, n) takes the first n characters and RIGHT(text, n) takes the last n. MID(text, start, n) takes n characters beginning at position start, where the first character is position 1. LEN(text) counts every character, and spaces and dashes count too.
Example: A2 holds the code TX-4827-B.
- LEFT(A2,2) = TX — First two characters
- MID(A2,4,4) = 4827 — Start at position 4, take 4
- LEN(A2) = 9 — Letters, digits and dashes all count
Why it works: Text is a row of characters numbered from 1, including spaces and dashes, so counting positions tells LEFT, RIGHT and MID exactly which characters to take.
Tip: To split a code at a dash without counting by hand, combine MID with FIND to locate the dash.