+ Reply to Thread
Results 1 to 9 of 9

transpose values into one row

  1. #1
    Registered User
    Join Date
    10-15-2013
    Location
    amsterdam, holland
    MS-Off Ver
    Excel 2010
    Posts
    8

    transpose values into one row

    Hello,

    In my attachment, I wish to transpose the values (after the semicolon) in a single row, based on the id in the first column. With the existing formula (dutch) (in column (K,L,M) I can only transpose the values to the same row. The attachment explains my problem.

    Thanks,

    Marcel
    Attached Files Attached Files

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: transpose values into one row

    Unfilter.
    Remove the extraneous examples leaving the raw data.
    In C2, then copied across and down:

    =TRIM(RIGHT(SUBSTITUTE(INDEX($B$1:$B$500, MATCH($A2&"*"&C$1&"*", INDEX($A$1:$A$500&$B$1:$B$500, 0), 0)), " ", REPT(" ", 50)), 50))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-15-2013
    Location
    amsterdam, holland
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: transpose values into one row

    Thanks for the effort, but this formula generates an error. And I haven't got a clue what the formula is about. So I can't alter it.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: transpose values into one row

    Perhaps a cut and paste error?

    This is several formulas merged into one.

    An INDEX() is created merging the values from column C and column B:
    INDEX($A$1:$A$500&$B$1:$B$500, 0)
    This creates an array with values in it that look like this:
    151206BI prio: 1
    151206BI impact: 3
    etc...

    Next we index column B, then match using the value in column A+wildcards+the label in C1+wildcards to the array we created above.
    INDEX($B$1:$B$500, MATCH($A2&"*"&C$1&"*", INDEX($A$1:$A$500&$B$1:$B$500, 0), 0))

    Used in C2, that brings back the value from B3 as the match. Now we want just the last word in that string. First we substitute all the spaces in that string with 50 spaces.
    SUBSTITUTE(INDEX($B$1:$B$500, MATCH($A2&"*"&C$1&"*", INDEX($A$1:$A$500&$B$1:$B$500, 0), 0)), " ", REPT(" ", 50))

    Then we use the RIGHT() function to just grab the last 50 characters. This gives us the last word only plus some of the spaces we added.
    RIGHT(SUBSTITUTE(INDEX($B$1:$B$500, MATCH($A2&"*"&C$1&"*", INDEX($A$1:$A$500&$B$1:$B$500, 0), 0)), " ", REPT(" ", 50)), 50)

    Lastly, we use the TRIM function to strip out any of those extra spaces.
    =TRIM(RIGHT(SUBSTITUTE(INDEX($B$1:$B$500, MATCH($A2&"*"&C$1&"*", INDEX($A$1:$A$500&$B$1:$B$500, 0), 0)), " ", REPT(" ", 50)), 50))


    When that formula is copied to the right, it changes from looking for 151206*prio* to looking for 151206*impact*, this finding B4, and from there going through the same final steps to strip out the last word only.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-15-2013
    Location
    amsterdam, holland
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: transpose values into one row

    Thanks again, but I still get the general error message for formula's. Maybe one last try : In the attachtment you'll see my short table, with your formula in the textbox. Maybe you can place the right formula in C2 and see what happens. I changed the indexes to rows 2-10 from your of 1-500 and the rows to match to 2 instead of 1. Because there is the data. Should be great if you get this working!

    Marcel
    Attached Files Attached Files

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

    Re: transpose values into one row

    I didn't download your file.

    As far as the general formula error...

    You may need to replace the commas with semi-colons.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Registered User
    Join Date
    10-15-2013
    Location
    amsterdam, holland
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: transpose values into one row

    Thanks! Works fine now!

    Marcel

  8. #8
    Registered User
    Join Date
    10-15-2013
    Location
    amsterdam, holland
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: transpose values into one row

    After replacing the comma's with semi-colons and not changing your index values , it works. Thanks for the great help! (my boss will be happy...)

    Marcel

  9. #9
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: transpose values into one row

    Glad it's working. My apologies, I never remember to look at the region people are asking from.

+ 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] Transpose Column to Row with formatting and values
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2013, 07:19 PM
  2. [SOLVED] Transpose values
    By leovilla in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2013, 08:11 AM
  3. Transpose values in each row into the same column
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 02-20-2012, 04:28 PM
  4. Transpose values ???
    By brooklyn in forum Excel General
    Replies: 0
    Last Post: 06-06-2007, 07:43 PM
  5. [SOLVED] I WANT TO TRANSPOSE LINKS, AS WE TRANSPOSE VALUES
    By Umair Aslam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-22-2005, 09: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