+ Reply to Thread
Results 1 to 4 of 4

Find the (n) matched of string in a string.

  1. #1
    Registered User
    Join Date
    07-21-2015
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    28

    Find the (n) matched of string in a string.

    Is there any SIMPLE excel function that can find the (n)th matched of a string in a string?
    I need to extract the number and text, separated by "+" as in example below:
    In cell A2 I have value: "abcd+123+xyz".
    This is what I'm doing:
    In cell A3, I add two more "++" to the end of A1 cell value
    Please Login or Register  to view this content.
    Cell A4 I have formular:
    Please Login or Register  to view this content.
    and cell A5:
    Please Login or Register  to view this content.
    and cell A6:
    Please Login or Register  to view this content.
    Is there anything like this:
    Please Login or Register  to view this content.
    without writing VBA code?

    I don't think there is such function, and I can find one more solution to my problem via this thread:
    http://www.excelforum.com/excel-form...r-x-and-y.html
    Last edited by gaixixon; 08-22-2016 at 11:38 PM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Find the (n) matched of string in a string.

    Look here

    http://www.excelforum.com/excel-gene...r-in-a-st.html

  3. #3
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Find the (n) matched of string in a string.

    simple....not quite
    generally a combination of formula's like you have done would be required

    based on your example....you want to find the string after the 2nd occurrence?

    here is how i would of done it

    assuming a2 is the cell you want to extract
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    char(95) [which is _ ] can be replace with anything you want...but should be something that does not appear in string itself
    What this formula does is find the 2nd occurrence of "+" and replaces it with "_"
    then it finds where _ is and left formula kicks in to return text up to where "_" was found
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    08-18-2016
    Location
    Earth
    MS-Off Ver
    2010 and 2013
    Posts
    64

    Re: Find the (n) matched of string in a string.

    Here is one you can use. It's not the most elegant, but works. Just put in whatever cell and drag down. This too assumes the text you want to extract is in A2.

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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: 4
    Last Post: 03-30-2015, 03:20 PM
  2. Replies: 5
    Last Post: 02-11-2015, 10:41 PM
  3. VBA Find Partial String in String Array and Output the Found String Array Value
    By scherich in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2014, 11:20 AM
  4. [SOLVED] problem finding string using .find method when string to be found contains ~ (a tilde)
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-01-2013, 07:38 AM
  5. [SOLVED] Vlookup, Match (Search or Find) partial string within string in a Cell
    By dluhut in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2013, 12:40 PM
  6. find how many times a word appears in a string at certain positions within the string
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-05-2013, 12:05 AM
  7. how to find Certain String in a column, select/Copy the cell till another String
    By excelkeechak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2009, 10:59 AM

Tags for this Thread

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