+ Reply to Thread
Results 1 to 6 of 6

Extract parameters from a string of text

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    UK
    MS-Off Ver
    2013
    Posts
    32

    Extract parameters from a string of text

    Hi guys,

    I'm trying to find a formula which in essence is the same as 'text to columns'.

    I'll be pasting in post strings such as: A=B&C=D&E=F etc etc.

    I need a formula to break the url so i have all the individual parameters listed i.e

    A=B
    &C=D
    &E=F

    Can this be done without a macro? Also i'm not fussed where the '&' belongs either at the front or the end of the text string.

    Thanks in advance,
    Lloyd

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Extract parameters from a string of text

    hi Lloyd. maybe:
    =TRIM(MID(SUBSTITUTE("&"&$A1,"&","&"&REPT(" ",100)),101+(COLUMNS($B1:B1)-1)*100,100))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    UK
    MS-Off Ver
    2013
    Posts
    32

    Re: Extract parameters from a string of text

    Hi Benishiryo,

    Thanks for the quick reply!

    It works to a degree, it is chopping some parameters though - i'll explain in more depth hopefully it will help.

    In cell A1 i will paste a string similar to:

    url=www.test.com/sale&value=100&ordertime=20.14&delivery=test_test_test_test

    Either below or alongside i'd like to see:

    url=www.test.com/sale
    &value=100
    &ordertime=20.14
    &delivery=test_test_test_test


    The parameter length can vary though between 5-10 chars and 9999 chars.

    Again thanks for your help,
    Lloyd

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extract parameters from a string of text

    Hi,

    Can you give a few more examples of strings that you are concerned with? Will they always be split following the same logic as the one you give?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    06-21-2012
    Location
    UK
    MS-Off Ver
    2013
    Posts
    32

    Re: Extract parameters from a string of text

    Hi,

    There are hundreds of the 'text=text' combinations but yes they are always split by a &.

    Thanks,
    Lloyd

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Extract parameters from a string of text

    Slight modification to benishiryo's formula:

    =TRIM(MID(SUBSTITUTE($A1,"&",REPT(" ",100)&"&"),1+(COLUMNS($B1:B1)-1)*100,100))

    Regards

+ 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] Find and extract text string from within another text string
    By huy_le in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2013, 03:22 PM
  2. Find and extract text string from within another text string
    By huy_le in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-09-2013, 09:01 PM
  3. [SOLVED] How to Extract A Number from String if Text within the String Equals XYZ
    By tyrsfury in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-15-2012, 03:30 PM
  4. [SOLVED] extract text string when you only know the last three letters of that string
    By alison0edwards in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-12-2012, 01:20 PM
  5. Extract small string of text from larger string
    By mark_jam3s in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2010, 05:36 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