Transpose rows for a single column based on equal value in other columns

Raghav Chamadiya

New Member
Joined
May 31, 2020
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hi, so I am trying to transpose the values of a single column into 3 seperate columns if all the other columns values are same. This is what my initial data looks like:
1611738224917.png

I want the data of column A split into column headings, right now it has 3 unique values: Batch1, Batch2, Batch3. And I want column E values to be inside those columns as rows with all other columns same.
For example if I apply filter on the actual data to make columns C same, it looks like this:
1611738224454.png


And in the final result, I want it like this:
1611738279007.png


Similarly for the other column C values as well. I was thinking of writing a VBA for this with a loop, but I am not sure how to do it. Any help will be really appreciated.
This is the google drive link to the file with public access: Excel Link
 

Attachments

  • 1611737356898.png
    1611737356898.png
    232.7 KB · Views: 15

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,

Try Power Query, Convert your excel data in Table (CTRL + T) and apply following transformation in Power query. Refer to outcome snapshot. It is a very quick transformation. With table in future if you add more data in table then refresh the output table.

I hope it will help.

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Batch Reference", type text}, {"Timepoint", type text}, {"Condition", type text}, {"T Reported Name", type text}, {"R Formatted Entry", type number}, {"R Reported Name", type text}}),
    #"Pivoted Column" = Table.Pivot(#"Changed Type", List.Distinct(#"Changed Type"[#"Batch Reference"]), "Batch Reference", "R Formatted Entry", List.Sum)
in
    #"Pivoted Column"
 

Attachments

  • Outocme.JPG
    Outocme.JPG
    56.4 KB · Views: 15
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,138
Members
453,021
Latest member
Justyna P

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