+ Reply to Thread
Results 1 to 4 of 4

REPLACE 2 different sets of variables?

  1. #1
    Registered User
    Join Date
    07-30-2008
    Location
    NY
    Posts
    19

    REPLACE 2 different sets of variables?

    I am currently using:

    =IF((K2="Use Landing Page URL Generator Tool"),"Use Landing Page URL Generator Tool",(REPLACE(K2,FIND("XXXX",K2),4,A2)))

    For amongst other things, to replace the variable 'XXXX' if the website that is in the cell next to the formula has 'XXXX' in it. It replaced this 'XXXX' with a 6 digit number from a list I have somewhere in the sheet.

    How would I add to this formula if I wanted to ALSO replace another variable like 'VVVV' if it showed up in the URL?

    The URL I have been using is:

    http://www._________________________...x?keycode=XXXX

    XXXX has been successfully getting replaced with a 6 digit number.

    Now the URL is going to be changed to:

    http://www._________________________...e=XXXX&vd=VVVV

    What do I add so that XXXX is replaced with the one column of numbers and the VVVV will also be replaced with the separate column of different numbers I have?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Possibly nest the Replace() functions...

    e.g.

    Please Login or Register  to view this content.
    where B2 contains the code to replace "VVVV" with
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-30-2008
    Location
    NY
    Posts
    19
    Hmm... this gives me a #VALUE!.

    Would a AND function be used here?

    Its simple logically what I want to do... just replace XXXX in the URL with one column of numbers and VVVV in that same URL with a second column of numbers.

    Tough to figure out though...

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Try:

    Please Login or Register  to view this content.
    or probably a lot better...use the SUBSTITUTE function...

    Please Login or Register  to view this content.
    Last edited by NBVC; 08-14-2008 at 01:19 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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