+ Reply to Thread
Results 1 to 2 of 2

Find String in Range and Extract

  1. #1
    Registered User
    Join Date
    12-23-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Find String in Range and Extract

    I need to search a line in a worksheet (across multiple columns) for a PO number then deposit/copy that number in a new cell (on the same line)

    All the PO numbers have set naming conventions like begins with P and is 5 characters long (P****). but the cell could have other characters before or after it (like PO# P***** or 586847/P*****)

    So in plain english I want it to search A1:D1 find P***** and if it finds P***** put it in E1.

    Can someone help me! Right now we are doing this for 1,000s of lines of data manually!

    Thanks!

    Jane

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Find String in Range and Extract

    Put this array formula in E1, press CTRL-SHIFT-ENTER to confirm it and activate the array. Then copy that cell down:

    =INDEX(MID(A1:D1,FIND("P",A1:D1,2),5), MATCH(1, 1/--(FIND("P",A1:D1,2)>0),0))


    This might not find them all, but it will find the two examples you gave.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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