+ Reply to Thread
Results 1 to 6 of 6

Extract varied character number string from URL

  1. #1
    Registered User
    Join Date
    12-17-2018
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    2

    Extract varied character number string from URL

    Hello, I'm new to the forum. I've been trying to solve this little formula for a few days, and can't quite crack how to extract a string of numbers that vary from 4 to 6 characters in length, and are numbers. They always sit in between a "/" and "."

    Here are a couple example URLs ( it wouldn't let me post the entire URL since it's my first post):

    /example-product-url-here/8552.html
    /example-product-url-here/175563.html

    I've tried the following formula:

    =mid(A29,Search("/",A29,50)+1,15)

    and it gives me this:

    8552.html
    175563.html

    but can't figure out how to get rid of the ".html" as well. Any help would be great!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Extract varied character number string from URL

    Maybe
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert dosydos's Avatar
    Join Date
    12-09-2015
    Location
    Massachusetts
    MS-Off Ver
    365(PC) V:2308
    Posts
    1,472

    Re: Extract varied character number string from URL

    This should work.

    =MID(A1,FIND("/",A1,10)+1,(FIND(".",A1)-1)-FIND("/",A1,10))

  4. #4
    Registered User
    Join Date
    12-17-2018
    Location
    Wisconsin
    MS-Off Ver
    365
    Posts
    2

    Re: Extract varied character number string from URL

    This worked perfectly. Thank you!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: Extract varied character number string from URL

    You're welcome. Thanks for the rep.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Extract varied character number string from URL

    Hi,

    Use this if your URL strings can possibly be of varying length, and the SEARCH for "/" may Not necessary produce the correct result if started at 50.

    This will produce the correct results for Any length URL, as long as the number you want is Always after the Last "/" :

    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. [SOLVED] Extract 2nd Character after space in string
    By sintek in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-08-2017, 08:12 AM
  2. [SOLVED] extract everything to the right of a character in string
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-19-2017, 12:12 AM
  3. [SOLVED] Removing varied number of letters from end of number-letter string
    By WhiskeyGolf in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-16-2015, 04:43 AM
  4. extract text from varied string
    By voicetec in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2013, 12:36 PM
  5. [SOLVED] extract string after nth string (special character)
    By itselflearn in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2013, 03:18 PM
  6. extract right character from string then add back to a number
    By HP RodNuclear in forum Excel General
    Replies: 2
    Last Post: 11-11-2010, 02:51 PM
  7. Extract Certain character from string
    By Kou Vang in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-25-2006, 03:30 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