+ Reply to Thread
Results 1 to 4 of 4

Need Excel formula or code for finding and extracting a string.

  1. #1
    Registered User
    Join Date
    12-10-2011
    Location
    Chennai
    MS-Off Ver
    Excel 2007
    Posts
    56

    Need Excel formula or code for finding and extracting a string.

    Hi All,

    I have a excel file with each cell having multiple rows of data in them.

    IP address starting "10.x.x.x" is one of values in the several rows of data in each cell.

    I need a formula or code, which looks for this IP address and generates it in the Output file.

    Kindly refer the sample file attached for more details.Sample Excel File.xlsx

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Need Excel formula or code for finding and extracting a string.

    Enter formula in B2 and pull it down

    =IF(--LEFT(TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",125)),125)),2)=10,TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",125)),125)),"NA")
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    07-13-2015
    Location
    Quebec, Canada
    MS-Off Ver
    2013
    Posts
    232

    Re: Need Excel formula or code for finding and extracting a string.

    Would this work?

    =IFERROR(MID(A2,FIND("10.",A2),(IFERROR(FIND(" ",A2,FIND("10.",A2)),LEN(A2)+1)-FIND("10.",A2))),"NA")

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Need Excel formula or code for finding and extracting a string.

    Maybe even this will work for you.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Replies: 10
    Last Post: 07-22-2015, 05:16 AM
  2. [SOLVED] Help with a formula for extracting a string
    By vanthetsar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-29-2015, 06:14 AM
  3. Extracting numbers from a string in a cell without recurring to VBA code
    By Guido Meng in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2013, 12:20 PM
  4. VBA code for extracting last three digits from alphanumeric string.
    By klantacook in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-01-2013, 05:30 PM
  5. Extracting String Using Formula
    By crazysniper in forum Excel General
    Replies: 6
    Last Post: 01-06-2012, 09:10 AM
  6. Excel Formula Help for Finding and Extracting Data
    By dlaw13 in forum Excel General
    Replies: 6
    Last Post: 01-21-2010, 03:10 PM
  7. Extracting Zip Code from Address String
    By lizzae in forum Excel General
    Replies: 1
    Last Post: 05-13-2009, 10:37 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