Excel’s new TEXTBEFORE function simplifies extracting text from the left. In this example I share how to extract all the text before a number in a code.
In the image below you can see the code (column A) and the extracted text (column B) plus the formula in column B (column C).
The SEQUENCE function provides an array (list) of the ten numbers from 0 to 9. You can see that in the image below where I have used the F9 key to calculate that part of the formula.
This array instructs the TEXTBEFORE function to treat each number as a delimiter (the character to find) to extract up to.
The 1 on the end of the TEXTBEFORE function instructs it to use the end as a delimiter. This handles the situation where no numbers are in the code.
Note: These functions are only available in the subscription version of Excel.
Please note: I reserve the right to delete comments that are offensive or off-topic.