+ Reply to Thread
Results 1 to 6 of 6

Removing variable length numeric ID from the end of a URL

  1. #1
    Registered User
    Join Date
    02-16-2006
    Posts
    39

    Question Removing variable length numeric ID from the end of a URL

    I have a set of URLs that end with a numeric ID of variable length (max 15 characters). The beginning of the numeric ID is always preceded by a forward slash. How do I create function to strip out the numeric ID only? Thanks.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,842

    Re: Removing variable length numeric ID from the end of a URL

    Without an example, you could try:

    =MID(A1,FIND("/",A1)+1,LEN(A1))

    Assuming the first cell with data you are trying to strip out is A1.

    - Moo

  3. #3
    Forum Guru Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Removing variable length numeric ID from the end of a URL

    try

    =RIGHT(A1,LEN(A1)-FIND("/",A1))
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    02-16-2006
    Posts
    39

    Re: Removing variable length numeric ID from the end of a URL

    I realized I forgot to include a key fact. The URLs will have more than one forward slash e.g., https://www.facebook.com/pages/The-D...37213556295908

  5. #5
    Forum Guru Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Removing variable length numeric ID from the end of a URL

    Try
    =TRIM(RIGHT(SUBSTITUTE(A1,"/",REPT(" ",255)),255))

  6. #6
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Removing variable length numeric ID from the end of a URL

    when you say remove ,do wish to capture the number or the string before the number? or split and get both
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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: 3
    Last Post: 11-21-2012, 03:28 PM
  2. Replies: 6
    Last Post: 04-14-2012, 04:07 AM
  3. Length of numeric entries in a form
    By sbernard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2010, 06:24 PM
  4. Removing non numeric rows
    By Alan M in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2006, 09:10 AM
  5. Removing Non-Numeric Characters
    By GlenS in forum Excel General
    Replies: 5
    Last Post: 10-12-2005, 06:05 AM

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