Reputation: 13
I have a column of cells in Google Sheets with text in the following formats:
PLAYBILL59; Code Description Here
BROADWAYBOX59: Code Description Here
TICKETCODE: Code Description Here
I want to create a formula that deletes everything after and including either a colon or semi-colon, that would leave:
PLAYBILL59
BROADWAYBOX59
TICKETCODE
I've been trying for hours with no luck.
Any suggestions very appreciated.
Upvotes: 1
Views: 2428
Reputation: 3663
Let's say that your colum is A, then you can use REGEXEXTRACT
in your formula like
=REGEXEXTRACT(A1; "[A-Z0-9-a-z]+")
Upvotes: 3
Reputation: 10259
Assuming your text string is in A1, try:
=SUBSTITUTE(SUBSTITUTE(A1, "; Code Description Here",""), ": Code Description Here", "")
Upvotes: 1