+ Reply to Thread
Results 1 to 4 of 4

Too difficult for me, please help.

  1. #1
    Registered User
    Join Date
    10-06-2005
    Posts
    5

    Too difficult for me, please help.

    I download data from a SAP table into an excel spreadsheet (2000), one field of which contains a string like:
    A=1,a=5,H=/H/<ip>/S/sapdp97/H/oss001,S=01,M=000,U=OSS_RFC,Z=CPIC,X=LB

    This string can contain values for A, a, B, G, g, H, I, i, L, M, N, N, O, Q, R, S, T, u, U, X, Z in the form A=<value> delimited by comma's. Not every string includes all options in which case it is just omitted.

    For each row I would like to copy the values into columns with matching headers.

    Looks like a nice enough challenge, but too hard for me to solve quickly. Thanks!
    Last edited by Menno; 10-06-2005 at 09:56 AM.

  2. #2
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I will assume you import your data into column A. Beginning in column B (say row 2) enter the values to look for, e.g. "A=", "a=", ....."X=", "Z=" should run through column V per your example of "A, a, B, G, g, H, I, i, L, M, N, n, O, Q, R, S, T, u, U, X, Z".

    With your imported data in A3, add a comma at the end of the last entry (e.g. ....Z=CPIC,X=LB,) then in B3 enter this Formula:

    =IF(ISERROR(MID($A$3,FIND(B2,$A$3,1)+2,FIND(",",$A$3,FIND(B2,$A$3,1))-(FIND(B2,$A$3,1)+2))),"",MID($A$3,FIND(B2,$A$3,1)+2,FIND(",",$A$3,FIND(B2,$A$3,1))-(FIND(B2,$A$3,1)+2)))

    This will return "1" (the value of "A=")

    copy this to C3 (the formula becomes: =IF(ISERROR(MID($A$3,FIND(C2,$A$3,1)+2,.......)

    and it will return "5" (the value of "a=")

    copy to D3 will return "" (a blank cell as there is no "B=" value)

    and so on through V3 which returns "CPIC" (the value of "Z=")

    NOTE: you must add the comma to the end of the data string in A3 for this formula to return the last value in the string!

    Does this work for you?
    Last edited by swatsp0p; 10-06-2005 at 11:10 AM.
    Bruce
    The older I get, the better I used to be.
    USA

  3. #3
    Registered User
    Join Date
    10-06-2005
    Posts
    5

    Thumbs up

    Works like a charm. Thank you very much Bruce. Have a nice weekend.

    Menno.

  4. #4
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I'm glad it worked for you. Thanks for the feedback, it is always appreciated.

    Cheers and a good weekend to you as well.

+ 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