How to remove text before a character
✓ Verified in LibreOffice 25.8.7.3Strip everything up to and including a marker — keep just the part after the colon, the last segment after a slash, the value after an equals sign.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel | =MID(A2,FIND(":",A2)+1,LEN(A2)) | FIND locates the marker; MID returns from just after it to the end. Excel 365 / Sheets: =TEXTAFTER(A2,":") is cleaner. Change ":" to your delimiter. |
| Google Sheets | =MID(A2,FIND(":",A2)+1,LEN(A2)) | Identical. =TEXTAFTER(A2,":") or =REGEXEXTRACT(A2,":(.*)") also work. |
| LibreOffice Calc | =MID(A2,FIND(":",A2)+1,LEN(A2)) | Identical; TEXTAFTER needs 24.8+. |
How it works
FIND returns the position of the marker, so FIND(":",A2)+1 is the first character AFTER it; MID then grabs from there to the end (passing LEN(A2) as the length just means 'take everything left'). For "code:1234" the colon is at position 5, so MID starts at 6 and returns "1234". Use SEARCH instead of FIND if you want case-insensitive matching or wildcards. This finds the FIRST occurrence — to cut after the LAST one (handy for file paths), the modern one-liner is TEXTAFTER(A2,"/",-1), or the classic trick swaps the last delimiter for a marker first. If the character might be missing, FIND errors with #VALUE!, so wrap in IFERROR(...,A2) to leave such rows untouched.
Verified, not just documented
We ran =MID("code:1234",FIND(":","code:1234")+1,LEN("code:1234")) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 1234 — exactly the expected result. Every formula here is confirmed by actually executing it.
Functions used
MID · FIND · LEN — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to extract the domain from an email address
- How to extract the last name from a full name
- How to capitalize only the first letter (sentence case)
- How to extract numbers from text in a cell
- How to extract text between two characters