+ Reply to Thread
Results 1 to 18 of 18

Transpose/Merge Two Column Data In Single Column

  1. #1
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Transpose/Merge Two Column Data In Single Column

    Hi all,

    i need formula not vba macro to transpose the data in "Column A" and "Column B" in "Column C" without loosing both "Column A and B" data.

    its hard to explain, but you can see in my table file below.

    Column A Column B Column C
    Fruit State Resault
    Apple Maxico Apple
    America Maxico
    Banana Britain America
    England Banana
    Carrot China Britain
    Argentina England
    Carrot
    China
    Argentina



    thank you.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transpose/Merge Two Column Data In Single Column

    try in C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    with CSE. It will show one column with no duplicates

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Last edited by sandy666; 05-19-2017 at 05:04 AM.

  3. #3
    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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    The original request specified "without losing data...". This MAY mean that any duplicate values should be KEPT and not discarded. If you want to keep duplicate values, you can use this array formula instead (in my sheet it's in E2):

    =IFERROR(INDIRECT(TEXT(SMALL(IF($A$2:$B$8<>"",(COLUMN($A$2:$B$8)+10*(ROW($A$2:$B$8)))),ROWS($E$2:E2)),"R00C0"),),"")

    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

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transpose/Merge Two Column Data In Single Column

    Thanks Glenn,
    I lost "without loosing both "Column A and B" data"

    grin.gif

  5. #5
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    woow...

    thank you mate.

    you two saving my life...

  6. #6
    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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  7. #7
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    sorry,

    can you please explain me the formula mean?.

    ={IFERROR(INDIRECT(TEXT(SMALL(IF($A$2:$B$8<>"",(COLUMN($A$2:$B$8)+10*(ROW($A$2:$B$8)))),ROWS($E$2:E2)),"R00C0"),),"")}

    thank you.

  8. #8
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transpose/Merge Two Column Data In Single Column

    Thanks for the feedback

  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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    OK. What was needed here was a way to "convert" all the non-blank values in your array into a series of ascending unique numbers. The relative ranking of those numbers would then determine the order in which SMALL would return them on the results column.

    Looking at your data the desired order within the data array was (R=Row, C=Column)
    R1C1
    R1C2
    R2C2
    R3C1
    R3C2, etc,

    corrresponding to
    Apple
    Mexico
    America
    Banana, etc

    So the COLUMN($A$2:$B$8)+10*(ROW($A$2:$B$8) bit multiplied the relative column number of each non-blank value by 1 (Column A) or 2 (column B); and multiplied the relative row number by 10 (row 1), 20 (row 2), etc and added them together.

    that yielded
    21
    22
    31
    41
    42, etc, with FALSEs interspersed wherever blank cells were found.

    So now you have the numbers in the correct order for SMALL to work on. All that remains is to convert the numbers back to cell values before delivering the result. thats what TEXT(xxx r00c0) does. It converts 21 into row 2, column 1 into "Apple"; 22 into row 2 column 2 into "Mexico" and so on...

    Clear??

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  10. #10
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    thank you very much mastar...

  11. #11
    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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    You're welcome.

  12. #12
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    hi again all master excel,

    i got same problem look like my old thread.

    i need formula to merge 2 column into 1 column. But all data in column state will merge
    one by one in column fruit.

    hope the my table show below will explain.

    thank you so much.


    Fruit State Resault
    Apple America Apple
    Banana] Maxico America
    Carrot Britain Maxico
    England Britain
    China England
    Argentina China
    Argentina
    Banana
    America
    Maxico
    Britain
    England
    China
    Argentina
    Carrot
    America
    Maxico
    Britain
    England
    China
    Argentina

  13. #13
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Transpose/Merge Two Column Data In Single Column

    use PowerQuery (add-in for Ex2010 from MS site)

  14. #14
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    thank you for replay,

    in my company pc, i cannot install any third party system.

    i need formula or vba code.

    thank you.

  15. #15
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Transpose/Merge Two Column Data In Single Column

    This is NOT third party software. MS Office is from Microsoft - Power Query is from Microsoft

    PQ is more secure than VBA

    but this is your choice

  16. #16
    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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    One way:
    =IFERROR(OFFSET($A$2,IF(MOD((ROWS($1:1)-1),7)=0,INT((ROWS($1:1)/7)),""),,,),OFFSET($B$1,MOD((ROWS($1:1)-1),7),,))

    similar...
    =IFERROR(OFFSET($A$2,IF(MOD((ROWS($1:1)-1),COUNTA(B:B))=0,INT((ROWS($1:1)/(COUNTA(B:B)))),""),,,),OFFSET($B$1,MOD((ROWS($1:1)-1),COUNTA(B:B)),,))
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    09-17-2012
    Location
    malaysia
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transpose/Merge Two Column Data In Single Column

    thank you so much master,

    work like charm.

  18. #18
    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
    43,986

    Re: Transpose/Merge Two Column Data In Single Column

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. how to transpose data fomr a single column.
    By jainny143 in forum Excel General
    Replies: 5
    Last Post: 06-10-2016, 12:07 PM
  2. Merge specific column data from multiple sheets in single column of new workbook.
    By kadam203 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2016, 01:58 AM
  3. Merge Multy Columns in Single column with data
    By sharma4845 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2014, 05:02 AM
  4. [SOLVED] Text to Column with Single Column Transpose - VBA code help
    By i2rule in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-13-2014, 05:09 PM
  5. Transpose Data from Multiple Column to Single Column
    By smudger1989 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-12-2013, 04:38 AM
  6. [SOLVED] Transpose rows into a single column with additional data
    By AlexRoberts in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2012, 08:13 AM
  7. [SOLVED] Transpose and Merge Variables into a Single Column
    By greatjobtoday in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-12-2012, 05:44 PM

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