Reordering data from several sheets into one

alhajoth

New Member
Joined
Jul 22, 2009
Messages
48
I have a workbook consisting of 58 sheets. I want the data from the other 57 sheets combined into one table in the 58th sheet.
The data-sheets are all identical, they look like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Some heading[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5 min[/TD]
[TD]10min[/TD]
[TD]15min[/TD]
[TD]20min[/TD]
[TD]30min[/TD]
[TD]60min[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]2342[/TD]
[TD]4343[/TD]
[TD]3222[/TD]
[TD]3431[/TD]
[TD]3432[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD]3433[/TD]
[TD]4444[/TD]
[TD]5555[/TD]
[TD]6666[/TD]
[TD]7777[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]1111[/TD]
[TD][/TD]
[TD]8888[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]9999[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The tables shows zipcodes within a certain range from a point. There are one sheet per point, the 6 distances (5, 10, 15, 20, 30 and 60) are always the same.
Each zipcode should only appear once per sheet, but due to errors in dataentry etc, there may be duplicates. So thats task 1, removing duplicates. In case of duplicates, the zipcode should always remain in the left-most column.

The columns are always constant, the number of rows will vary greatly from column to column and from sheet to sheet.

What I want to create in sheet 58 is the following table:

[TABLE="width: 500"]
<tbody>[TR]
[TD]ZIPCODES[/TD]
[TD]sheet1[/TD]
[TD]sheet2[/TD]
[TD]sheet3[/TD]
[TD]sheet4[/TD]
[TD]sheet5[/TD]
[/TR]
[TR]
[TD]0001[/TD]
[TD]5[/TD]
[TD]10[/TD]
[TD]15[/TD]
[TD]5[/TD]
[TD]60[/TD]
[/TR]
[TR]
[TD]0002[/TD]
[TD][/TD]
[TD]15[/TD]
[TD]30[/TD]
[TD]60[/TD]
[TD]20[/TD]
[/TR]
[TR]
[TD]0003[/TD]
[TD]5[/TD]
[TD][/TD]
[TD]5[/TD]
[TD][/TD]
[TD]10[/TD]
[/TR]
</tbody>[/TABLE]


Where each possible zipcode is listed in rows, and the distance from each sheet is listed. The column-headings are identical to the sheet-names.
There are 3351 total zipcodes, they do not all appear in the data-sheets, but they are in my masterlist. There will by 58 columns total, the zipcodes and 57 columns corresponding to the sheets.

So what is the simplest and quickest way to do this?
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
On the assumption that your 57 sheets are named as shown (i.e. Sheet1, Sheet2, etc.):

1. On your summary sheet, set up headings in A1:BF1 as you've shown in the second table, viz:
[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD]ZIPCODES
[/TD]
[TD]sheet1[/TD]
[TD]sheet2[/TD]
[TD]sheet3[/TD]
[TD]sheet4
[/TD]
[TD]sheet5 .... Sheet57
[/TD]
[/TR]
</tbody>[/TABLE]
(The column headings in B1:BF1 must be EXACTLY the same as the sheet/tab names - ensure there are no spaces in either!)

2. In B2, enter the following formula:
=COUNTIFS( INDIRECT( B$1 & "!A:F"), $A2 )
then copy to B2:BF3353.

Voilà!
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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