Take a fixed number of characters from the start of a cell.
Copy this formula
=LEFT(A2, 5)LEFT returns the first N characters; RIGHT returns the last N; MID returns characters from a chosen start point. They're the building blocks for slicing codes, prefixes, and fixed-width data.
=RIGHT(A2, 4)→2026Last four characters, e.g. a year.
=LEFT("INV-2026-0042", 3)→INVThe first three characters of a code.
=LEFT(A2, FIND("-", A2)-1)→INVTakes everything before the first hyphen, whatever its length.
From the middle
=MID(A2, 4, 3)3 characters starting at position 4.
Use =LEFT(A2, LEN(A2)-3) to remove the final three characters.
LEFT always returns text. Wrap it in VALUE to get a number back: =VALUE(LEFT(A2, 3)).
Use =RIGHT(A2, LEN(A2)-3) or =MID(A2, 4, LEN(A2)) to drop the first three characters.
It works on the underlying serial number, not the displayed date. Convert first: =LEFT(TEXT(A2, "yyyy-mm-dd"), 4) returns the year.
Need a formula for your own data?
Describe what you want in plain language and let ExcelGPT write, explain, and verify the formula — free to start, no plugin.