+ Reply to Thread
Results 1 to 5 of 5

Position of short string in large string

  1. #1
    Registered User
    Join Date
    06-14-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    20

    Position of short string in large string

    Hello,
    is there a possibility to get the character position of a shorter string from a larger one by formula?
    In this example the short string in Column A starts from character 4 and goes to character 8 in the larger string (clomunB).
    Just getting the first number would be enough, the rest isnīt hard but how do I get that the short one starts at position 4 of the large one?

    ColumnA_____CoumnB_____ColumnC
    defgh_______abcdefghij____4-8

    Thank you for helping!

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    8,129

    Re: Position of short string in large string

    How about:
    =SEARCH(B1,A1)&"-"&SEARCH(B1,A1)+LEN(B1)

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    8,129

    Re: Position of short string in large string

    Sorry please ignore #2 and try again with:
    =SEARCH(A1,B1)&"-"&SEARCH(A1,B1)+LEN(A1)-1

  4. #4
    Registered User
    Join Date
    06-14-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: Position of short string in large string

    wow so easy; Thank you.

  5. #5
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Rocester, New York, USA
    MS-Off Ver
    Excel 2007:10
    Posts
    2,019

    Re: Position of short string in large string

    Please Login or Register  to view this content.
    Will return the index where the text string A1 in cell A1 exists inside the text string inside B1.

    As for ending position, you can find it with the start position + LEN(A1)-1

+ 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. Trying to match partial string with another string and give position or cell
    By pat3white in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 07-01-2013, 10:07 AM
  2. Replies: 2
    Last Post: 02-26-2008, 03:22 PM
  3. getting position of a word in a string
    By vkkishore_s in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2007, 10:33 AM
  4. Short string limitations?
    By F*SH in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2006, 04:54 AM
  5. Position in a string
    By vernalGreens@gmail.com in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2006, 11:15 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