Extract Text Before a Number in Excel

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.