Horizontal to Vertical - Transpose

soumen21

New Member
Joined
Aug 16, 2019
Messages
35
Hi Experts,

I have few data like this

CatalogueProduct LineDescriptionMarking1Marking2Marking3Marking4Marking5Marking6Marking7Marking8Marking9Marking10Marking11Marking12Marking13Marking14Marking15
Catalogue1P1Description 12014CECE MarkChina RoHS2CUTR-EMCEACEU-ATEXEU-EMCFCC-A(verified)UL Listed
Catalogue2P2Description 22014CEABSCE MarkChina RoHS2CUTR-EMCDNVEACEU-ATEXEU-EMCFCC-A(verified)UL Listed


I want to sort it like below.

CatalogueProduct LineDescriptionMarking
Catalogue1P1Description 12014CE
Catalogue1P1Description 1CE Mark
Catalogue1P1Description 1China RoHS2
Catalogue1P1Description 1CUTR-EMC
Catalogue1P1Description 1EAC
Catalogue1P1Description 1EU-ATEX
Catalogue1P1Description 1EU-EMC
Catalogue1P1Description 1FCC-A(verified)
Catalogue1P1Description 1UL Listed
Catalogue2P2Description 22014CE
Catalogue2P2Description 2ABS
Catalogue2P2Description 2CE Mark
Catalogue2P2Description 2China RoHS2
Catalogue2P2Description 2CUTR-EMC
Catalogue2P2Description 2DNV
Catalogue2P2Description 2EAC
Catalogue2P2Description 2EU-ATEX
Catalogue2P2Description 2EU-EMC
Catalogue2P2Description 2FCC-A(verified)
Catalogue2P2Description 2UL Listed

Could you please guide how to do?

Best Regards
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
If there isn’t much data, using the transpose method to process it row by row would be more efficient. If there are many rows, you might consider using VBA to process the data. Alternatively, you can use SQL. If you'd like to use SQL, I’d be happy to help you write one (for free). :)
 

Attachments

  • Image 11.png
    Image 11.png
    34.8 KB · Views: 5
Upvote 0
Unpivot the data using Power Query

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Catalogue", "Product Line", "Description"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Value", "Marking"}}),
    #"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"Attribute"})
in
    #"Removed Columns"

Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0
I used a tool to create a small program to accomplish this task.
The steps are as follows:

  1. Create a table (t_pp) in the database with column names that match those in your Excel sheet.
  2. Then, use the tool to import the Excel data into the t_pp table.
  3. Run an SQL query to insert each record's Catalogue, Product Line, Description, and Marking1 through Marking15 into another table, t_pp_2.
  4. Finally, retrieve the processed results from the t_pp_2 table.
If needed, I can send you the program I created. You’ll just need to click a button in the interface to import the table into the database and then export the resulting table.

The final output looks like this:
 

Attachments

  • Image 2.png
    Image 2.png
    143 KB · Views: 5
  • Image 4.png
    Image 4.png
    10.8 KB · Views: 3
  • Image 3.png
    Image 3.png
    36.1 KB · Views: 3
Upvote 0

Forum statistics

Threads
1,224,045
Messages
6,176,067
Members
452,703
Latest member
kinnowboxes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top