What's new
Fantasy Football - Footballguys Forums

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

ExcelGuys - extracting a number from a text string (1 Viewer)

Anyone know a formula I could use in Excel that could extract the numbers from just the left side of a text string that always contains a hyphen in the middle?

For example:

72021969-101 Wells

How do I pull just the left sided number into a separate cell and leave out the “101” and everything else?  Note that the number of digits on the left could vary in size so a simple “=LEFT” function wouldn’t consistetly work.  I also found a more complex function on the inter webs involving LEN and SUBSTITUTE functions but it doesn’t seem to want to cut out digits to the right of the dash.

TIA

 
Is the data static?  Does it need to be a formula?  Would delimited text-to-columns work?

 
Anyone know a formula I could use in Excel that could extract the numbers from just the left side of a text string that always contains a hyphen in the middle?

For example:

72021969-101 Wells

How do I pull just the left sided number into a separate cell and leave out the “101” and everything else?  Note that the number of digits on the left could vary in size so a simple “=LEFT” function wouldn’t consistetly work.  I also found a more complex function on the inter webs involving LEN and SUBSTITUTE functions but it doesn’t seem to want to cut out digits to the right of the dash.

TIA
My cheater method is to use Text-To-Columns and then use the minus sign as the delimiter.

 

Users who are viewing this thread

Back
Top