gilbertgrape87

New Member
Joined
Apr 26, 2018
Messages
2
Hey everyone. Just wanted to started saying off by thanks! This forum has been invaluable whenever I am looking for solutions to problems.

This time though, I'm having trouble finding a good solution.

I have some poorly formatted data that I would like to be able to index, so I am trying to consolidate it.

Any ideas would be greatly appreciated! Thanks in advance!

Gilbert


Essentially, I have a table that looks like this:

A
B
C
X
1
2
X
3
4
Y
3
4
Y
5
6
Z
1
4
Z
5

<tbody>
</tbody>


And I'm looking to turn it into this:

A
B
C
X
1
2
3
4
Y
3
4
5
6
Z
1
4
5

<tbody>
</tbody>
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Can probably just run a VBA loop, but not sure what the data looks like. Here are a couple questions.

Does the data always go consecutively in Row Headings, X1 X2 X3 then Y1 Y2, etc? Is there never overlap on the values, so X1 and X2 will never both have a value in Column "A", if there is a Value in "A" for both X1 and X2 how are you treating it? Should the blank column headers have names?
 
Upvote 0
Copy your first table to range A1:G7, and copy the second table to range A12:G15, enter the following formula in cell B13:
Code:
=IFERROR(INDEX(B$1:B$7,TEXT(SUM(($A$2:$A$7=$A13)*(B$2:B$7<>"")*ROW(B$2:B$7)),"0;;")),"")
Ctrl+shift+enter run the formula, and copy to range B13:G15.

for the list in A13:A15, the unique value of X,Y,Z you can use many way to get.
 
Upvote 0
Thanks for the responses. I'll play with that indexing statement here in a bit.

In the meantime, here's one of the tables:

https://www.dropbox.com/s/98gz8gyn9dhsvmq/Book1.xlsx?dl=0

There should be no overlapping data when the rows are consolidated. notice that there are 5 (!) columns worth of headers, those are largely redundant and currently only there to assist me in indexing. I will likely (and am certainly willing) to delete all of them except the green one, especially to assist in this manipulation.

Notice the column headers repeat for class 1, class 2, class 3, etc.

Thanks!
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,864
Members
449,052
Latest member
Fuddy_Duddy

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