+ Reply to Thread
Results 1 to 4 of 4

Extract text based on delimiters using formula. And then incorporate to INDEX MATCH

Hybrid View

STUARTXL Extract text based on... 07-19-2016, 10:52 AM
JohnTopley Re: Extract text based on... 07-19-2016, 11:18 AM
STUARTXL Re: Extract text based on... 07-20-2016, 02:09 AM
JohnTopley Re: Extract text based on... 07-20-2016, 03:52 AM
  1. #1
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Extract text based on delimiters using formula. And then incorporate to INDEX MATCH

    Hi All,

    I was recently shown a way to extract specific text between delimiters using only a formula, but I can't for the life of me remember it.

    For example, if I have the following text:

    ONE/TWO/THREE/FOUR

    and I would like to extract the third field 'THREE' then I can use a formula in another cell to do this. Does anyone know what this formula is?

    Moreover, does anyone know how I could fit this formula into an INDEX MATCH function? That is to say, my current index match is picking up the entire string 'ONE/TWO/THREE/FOUR' but I want it to pick up only the third field

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,684

    Re: Extract text based on delimiters using formula. And then incorporate to INDEX MATCH

    This will extract THREE given the format is always as your post

    =TRIM(MID(SUBSTITUTE(A1,"/",REPT(" ",250)),501,250))

  3. #3
    Banned User!
    Join Date
    09-26-2015
    Location
    Manchester
    MS-Off Ver
    2013
    Posts
    218

    Re: Extract text based on delimiters using formula. And then incorporate to INDEX MATCH

    Hi John,

    Thanks for this. It works perfect. But in the spirit of learning, could you explain what this formula does. I'd like to know what to change if I ever want to pick up the first, second or fourth field etc.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,684

    Re: Extract text based on delimiters using formula. And then incorporate to INDEX MATCH

    This is common method of separating text which has a common delimter.

    Do the following:

    in A1

    ONE/TWO/THREE/FOUR

    in B1

    =TRIM(MID(SUBSTITUTE($A1,"/",REPT(" ",250)),(COLUMNS($A:A)-1)*250+1,250))

    Drag the formula across to column E

    You will see each element of the text string appear in B1 to E1

    We substitute the "/" with 250 blanks (SUBSTITUTE($A1,"/",REPT(" ",250) so create a very large text string

    As the cell is dragged across the cells we use MID to select 1 to 250 in B1, 251 to 500 in C1, 501 to 750 in D1 and 751 to 1000 in E1 using

    (COLUMNS($A:A)-1)*250+1,250)

    COLUMNS($A:A) increments: 1, 2 COLUMNS($A:B), 3, 4 as its dragged across the columns

    So you will see THREE is in D1 which starts at MID 501 ... hence

    =TRIM(MID(SUBSTITUTE(A1,"/",REPT(" ",250)),501,250))

    Hope this explains how this works.

+ 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. Split data by delimiters but by formula (not Text to Columns)
    By STUARTXL in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-19-2016, 05:44 AM
  2. [SOLVED] IF INDEX MATCH based on result of formula
    By SLIM512 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-01-2016, 09:46 AM
  3. [SOLVED] Extract string between delimiters
    By Apexeon in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-27-2015, 06:23 PM
  4. Extract data from one sheet to another (Index/Match Formula)
    By pauldaddyadams in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-31-2013, 06:51 PM
  5. Replies: 4
    Last Post: 06-06-2010, 07:13 PM
  6. [SOLVED] Extract based on Delimiters
    By ssjody in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2005, 11:30 AM
  7. [SOLVED] Keep text color from a Index Match Formula
    By Woody in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-21-2005, 01:05 PM

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