+ Reply to Thread
Results 1 to 7 of 7

Extracting Everything LEFT of First Number

  1. #1
    Registered User
    Join Date
    01-29-2015
    Location
    Michigan
    MS-Off Ver
    2010
    Posts
    3

    Extracting Everything LEFT of First Number

    Good Afternoon,

    I’ve been struggling with an Excel 2010 sheet and I’ve finally come to the conclusion that I have to reach out for help. In the attached example, I am trying to extract just the name of the individual at the address listed. Sometimes the address is on the second line, other times the address is combined with the name on the first line. As you can see from the formula in column B, I’m trying to use the LEFT FIND command. I want the formula to extract everything to the left of the first numerical character found. For some reason the array is not working and the formula only extracts everything to the left of the first number of the array, which in this case is "0". It Extracts everything but the last section of the Zip Code in B1, and everything left of the street address is B2 because it encounters a "0". What needs to happen in order to get the formula to extract everything left of the first number encountered? Thanks in advance,
    Attached Files Attached Files

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Extracting Everything LEFT of First Number

    How about:

    =LEFT(A1,MIN(IF(ISNUMBER(FIND({0;1;2;3;4;5;6;7;8;9},A1)),FIND({0;1;2;3;4;5;6;7;8;9},A1)))-2)
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Extracting Everything LEFT of First Number

    Try this in B1 and copy down:
    Please Login or Register  to view this content.
    Please let us know if it worked for you.

    Pete

  4. #4
    Registered User
    Join Date
    01-29-2015
    Location
    Michigan
    MS-Off Ver
    2010
    Posts
    3

    Re: Extracting Everything LEFT of First Number

    Great guys!!! BOTH of those solutions worked. If you have the time I'd be interested in a breakdown on what those formulas are saying. Why didn't my original array work?

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Extracting Everything LEFT of First Number

    Buildin on Pete's amazing magical formula:

    Line 2!

    =MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))+1,FIND(CHAR(10),A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))-MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")))

    Seriously Pete, that was awesome.

  6. #6
    Registered User
    Join Date
    01-29-2015
    Location
    Michigan
    MS-Off Ver
    2010
    Posts
    3

    Re: Extracting Everything LEFT of First Number

    I got about halfway through that and my nose started bleeding.

    Thanks for your expertise, gents.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Extracting Everything LEFT of First Number

    Quote Originally Posted by PeteABC123 View Post
    =LEFT(A1,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A1&"0123456789"))-1)
    Just because I'm "different"...

    ...A1&"0123456789"

    If you put the 0 after the 9 then you can eliminate the quotes:

    ...A1&1234567890
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. extracting text left of second hyphen
    By nikoelnutto in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2012, 10:44 AM
  2. [SOLVED] Extracting left numbers from alphanumeric field
    By sweetkel23 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2012, 08:00 PM
  3. [SOLVED] Extracting a word to the left of an opening bracket
    By Glenn Kennedy in forum Excel General
    Replies: 5
    Last Post: 07-08-2012, 09:57 AM
  4. Replies: 2
    Last Post: 06-22-2010, 09:07 AM
  5. Replies: 4
    Last Post: 01-02-2007, 07:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1