Combining multiple collumns to create a single consolidated list

jonjonjonjon

New Member
Joined
Apr 26, 2017
Messages
12
Hi guys,

Is there a way to pick out cells that contain text from multiple columns and aggregate them into one single list?

eg: Problem:[TABLE="width: 500"]
<tbody>[TR]
[TD]red[/TD]
[TD][/TD]
[TD]circle[/TD]
[TD][/TD]
[TD]table [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD]square[/TD]
[TD][/TD]
[TD]book[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[TD][/TD]
[TD]triangle [/TD]
[TD][/TD]
[TD]pencil[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]green[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Result needed:

[TABLE="width: 500"]
<tbody>[TR]
[TD]red[/TD]
[/TR]
[TR]
[TD]Blue[/TD]
[/TR]
[TR]
[TD]green[/TD]
[/TR]
[TR]
[TD]circle[/TD]
[/TR]
[TR]
[TD]square[/TD]
[/TR]
[TR]
[TD]triangle [/TD]
[/TR]
[TR]
[TD]table [/TD]
[/TR]
[TR]
[TD]book[/TD]
[/TR]
[TR]
[TD]pencil[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi,

Based on (non-numeric) data in A1:E5, array formula**:

=IF(ROWS($1:1)>COUNTIF($A$1:$E$5,"?*"),"",INDIRECT(TEXT(SMALL(IF($A$1:$E$5<>"",10^5*ROW($A$1:$E$5)+COLUMN($A$1:$E$5)),ROWS($1:1)),"R0C00000"),0))

and copied down until you start to get blanks for the results.

Slightly more complex set-up if you insist on the returns being in order of their respective column positions, as opposed to row positions which the above favours.

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0
ah sorry one more question!

What happens if the columns are separated with additional information that does not need to be taken into account?

Many thanks!
 
Upvote 0
Hi,

The targeted columns will be separated by several other irrelevant columns and are across multiple worksheets. So essentially taking specific columns across multiple worksheets and combining them into one list.

Kind Regards
 
Upvote 0
So you might have 2 columns from one worksheet, 3 from another, 10 from another, etc., all potentially separated within their respective worksheets by several columns?

Regards
 
Upvote 0
That's exactly right.

That said, note that the "separated by several columns" will be a constant number of columns, say 6. That is, the layout of each sheet is exactly the same - in each sheet, so i want columns 3, 9, 15, so on and so forth (so a difference of 6 columns).

Regards
 
Upvote 0
This is quite straightforward with VBA. Using worksheet formulas alone it is doable, though a touch complex.

What's your preference?

Regards
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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