+ Reply to Thread
Results 1 to 10 of 10

How can I extract the nth instance of text between two strings?

Hybrid View

  1. #1
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,306

    Re: How can I extract the nth instance of text between two strings?

    Welcome to the forum.

    Assuming the text is in A2, try this in B2 drag copied to the right:

    =TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($A2,"<li>","|"),"</li>","|"),"|",REPT(" ",LEN($A2))),(COLUMNS($A:A)-1)*LEN($A2)+1,LEN($A2)))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  2. #2
    Registered User
    Join Date
    07-20-2019
    Location
    Cairns, Australia
    MS-Off Ver
    2016
    Posts
    3

    Re: How can I extract the nth instance of text between two strings?

    Thanks, but all I got was the text before the first <li>. I know what dragged copied to the right means but I'm not sure how I am supposed to apply that. I just entered the formula into B2 to get the result I got.

+ 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. [SOLVED] Extract text before the first instance of period or hyphen
    By gratedane8 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-20-2017, 10:31 AM
  2. [SOLVED] Trying to extract text cells at the first instance of four consecutive numbers
    By portokie in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-15-2016, 06:32 PM
  3. [SOLVED] Extract all text from right until first instance of symbol
    By Daedra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-19-2015, 06:28 AM
  4. [SOLVED] Extract numbers before first instance of text
    By pauldaddyadams in forum Excel General
    Replies: 5
    Last Post: 08-12-2014, 07:34 AM
  5. Extract text strings
    By wazing in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-22-2010, 01:25 PM
  6. How to Extract Text Before Second Instance of a Symbol
    By lionsdeal in forum Excel General
    Replies: 2
    Last Post: 08-04-2009, 02:28 PM
  7. extract text strings
    By jhelliar in forum Excel General
    Replies: 5
    Last Post: 09-16-2008, 12:19 PM

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