+ Reply to Thread
Results 1 to 10 of 10

How can i remove remove the last "?" from a cell/url string?

  1. #1
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    How can i remove remove the last "?" from a cell/url string?

    Does anyone know a formula for removing the last question mark in a URL string?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How can i remove remove the last "?" from a cell/url string?

    Maybe something like this:

    =SUBSTITUTE(A1,"?","",LEN(A1)-LEN(SUBSTITUTE(A1,"?","")))

    Show us a few examples of what you have and what you want.
    Last edited by Tony Valko; 07-21-2015 at 01:49 PM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: How can i remove remove the last "?" from a cell/url string?

    Samples would help.

    If it is the very last character, then maybe...
    =LEFT(A1,LEN(A1)-1)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: How can i remove remove the last "?" from a cell/url string?

    try this:

    =SUBSTITUTE(A1,RIGHT(A1,1),REPT(" ",1000))
    If I've helped U pls click on d *Add Reputation

  5. #5
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: How can i remove remove the last "?" from a cell/url string?

    Quote Originally Posted by Tony Valko View Post
    Show us a few examples of what you have and what you want.
    Before
    http://abc.com/join?
    http://abc.com/join?WT.mc_id=10938&u...quote_request?

    After
    http://abc.com/join
    http://abc.com/join?WT.mc_id=10938&u..._quote_request

    The last ? mark should be removed thanks.

  6. #6
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: How can i remove remove the last "?" from a cell/url string?

    Also not all the URL's have a ? mark at the end so removing the last character wouldn't work as it would break the URL.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: How can i remove remove the last "?" from a cell/url string?

    OK, the formula in reply #2 should do what you want.

  8. #8
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: How can i remove remove the last "?" from a cell/url string?

    then Tony's formula should do the trick or:

    =SUBSTITUTE(A1,"?",REPT(" ",1000))

  9. #9
    Forum Contributor
    Join Date
    04-26-2013
    Location
    Orlando
    MS-Off Ver
    Excel 2016
    Posts
    191

    Re: How can i remove remove the last "?" from a cell/url string?

    Quote Originally Posted by bhenlee View Post
    then Tony's formula should do the trick or:

    =SUBSTITUTE(A1,"?",REPT(" ",1000))
    Tried both but both removed a portion of the URL

    http://forms.abc.com/autos/battery-s..._quote_request

    =SUBSTITUTE(H27616,"?","",LEN(H27616)-LEN(SUBSTITUTE(H27616,"?",""))) <--this removed the ? mark after service.
    =SUBSTITUTE(H27617,"?",REPT(" ",1000)) <--This removed everything everything after the word service.

  10. #10
    Valued Forum Contributor
    Join Date
    02-07-2013
    Location
    Philippines
    MS-Off Ver
    Excel Online; 365
    Posts
    610

    Re: How can i remove remove the last "?" from a cell/url string?

    did you try the formulas on the samples you provided?

    can you post the data in cells H27617 and H27616

+ 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. "Add Row" and "Remove Row" Buttons... adding rows with formulas down filled
    By excelatnothing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2015, 02:44 AM
  2. [SOLVED] VBA help needed to remove all "/" then replace with "-" from cell "B3"and "B5"
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-17-2014, 02:11 PM
  3. [SOLVED] remove the "*" in text string
    By orozvik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-16-2014, 04:04 PM
  4. [SOLVED] UDF to remove "equivalent" expressions from a ";" delimited string
    By dredwolf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2012, 07:25 PM
  5. How to remove value of "a1" from string in "b1"
    By Protozin in forum Excel General
    Replies: 9
    Last Post: 12-14-2011, 11:45 AM
  6. Macro to trim a cell and remove string "THRU"
    By Rocker7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-15-2010, 01:24 AM
  7. Remove "TRUE" "FALSE" words from a linked checkbox
    By MDCK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2008, 03:26 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