+ Reply to Thread
Results 1 to 9 of 9

Move row values to columns?

  1. #1
    Registered User
    Join Date
    09-26-2017
    Location
    Sweden
    MS-Off Ver
    Office 2013
    Posts
    16

    Move row values to columns?

    I have repeating values in column A.
    Column B has two or more values that are different from eachother.
    I'd like to lift the values from Column B to a new column - to achieve to have column A witout repeating values.

    Not sure how else to explain - maybe this image helps?


    Capture.GIF

    thanks!

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Move row values to columns?

    Hi,

    Welcome to the Forum.

    Can you post the example file in excel format instead of .jpeg?

  3. #3
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Move row values to columns?

    Row\Col
    A
    B
    C
    D
    E
    F
    2
    50001
    2
    1087
    944
    3
    50001
    2
    944
    944
    4
    60001
    4
    911
    534
    1019
    728
    5
    60001
    4
    534
    534
    1019
    728
    6
    60001
    4
    1019
    534
    1019
    728
    7
    60001
    4
    728
    534
    1019
    728
    8
    70001
    2
    1048
    647
    9
    70001
    2
    647
    647


    D2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy across
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Move row values to columns?

    To return a list of uniquer column A values, in E2:

    =IFERROR(INDEX($A$2:$A$15,MATCH(0,INDEX(COUNTIF($E$1:$E1,$A$2:$A$15),0),0)),"")

    to return the other values, in F2, copied across and down, an array formula:

    =IFERROR(INDEX($B:$B,SMALL(IF($A$2:$A$15=$E2,ROW($A$2:$A$15)),COLUMNS($F2:F2))),"")

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Move row values to columns?

    Hi all. Here's the solution to an identical problem:

    Row\Col
    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    4
    Part # Code Part # Codes
    5
    EE01464 ABC 907 AAA EE01464 ABC 907 AAA ABC 907 BBB
    6
    EE01464 ABC 907 BBB EE01487 ABC 915 BBB
    7
    EE01487 ABC 915 BBB EE01554 ABC 907 AAA ABC 907 BBB
    8
    EE01554 ABC 907 AAA
    9
    EE01554 ABC 907 BBB


    This generates a list of unique part #s. Paste in D5 and copy down:
    Please Login or Register  to view this content.
    ...and this finds the codes for each part #. Paste in E5, copy across AND down:
    Please Login or Register  to view this content.
    Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
    Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee

  6. #6
    Registered User
    Join Date
    09-26-2017
    Location
    Sweden
    MS-Off Ver
    Office 2013
    Posts
    16

    Re: Move row values to columns?

    trying it now, computer is a bit slow and old...processing 4000 rows is hard work for it

    Thanks - I'm sure it works! Super-clever ppl!

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Move row values to columns?

    Who are you talking to???

  8. #8
    Registered User
    Join Date
    09-26-2017
    Location
    Sweden
    MS-Off Ver
    Office 2013
    Posts
    16

    Re: Move row values to columns?

    All of you!

    However, I used your file Glenn - and computer is still processing. I will have to copy/paste-special of the first column when it is done to do the array formula. Do you think it will still work? There is no way I can keep the formula in the first column and add new formula - computer will not be able to handle it.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Move row values to columns?

    The second formula should be OK. However, identifying unique values will be mightily slow. So... Let's try a different approach.

    Open, enabling macros, and hit the button....

    My VBA skills are non-existent. I know the second formula will work fine, 'cos I've tried it already. In your real data, you will have to adjust the ranges and drag it to the right until at least one column of blanks appears.
    Attached Files Attached Files

+ 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. Replies: 1
    Last Post: 07-01-2016, 11:54 AM
  2. VBA Code to move sub-total formula values 2 columns to the right and 1 row above
    By AliJWood in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-08-2016, 07:57 AM
  3. Replies: 12
    Last Post: 03-14-2016, 08:42 AM
  4. Code needed to move values from columns to rows
    By rs1aj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-02-2015, 04:00 PM
  5. Move/sort values from multiple columns
    By adr88 in forum Excel General
    Replies: 5
    Last Post: 03-21-2014, 04:26 PM
  6. Replies: 6
    Last Post: 07-02-2012, 12:20 AM
  7. have reference cells move in rows while I move in columns
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2011, 09:33 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