Combine multiple list while removing spaces in between and keeping duplicates

keenetics

New Member
Joined
Jun 23, 2013
Messages
3
Hi, I've been trying to come up with a formula that combines multiple list while removing spaces in between and keeping duplicates but to no success. Is there any formula to do this?

E.g.
List1
List2
List3
Combined
Apple
Apple
Apple
Paper
Paper
Food
Food
Apple
Apple
Orange
Tomato
Apple
Orange
Tomato

<tbody>
</tbody>


Thanks!
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

jbeaucaire

Well-known Member
Joined
May 8, 2002
Messages
6,012
This answer is LEAST confusing without the titles in row1. Put the list1, list2 and list3 in A1:A7, B1:B7, C1:C7, the enter this ARRAY formula in D1:

=IF(ROW()<=COUNTA($A$1:$A$7), INDEX($A$1:$A$7, SMALL(IF($A$1:$A$7<>"", ROW($A$1:$A$7), ""), ROW())),
IF(ROW()<=COUNTA($A$1:$B$7), INDEX($B$1:$B$7, SMALL(IF($B$1:$B$7<>"", ROW($B$1:$B$7), ""), ROW()-COUNTA($A$1:$A$7))),
IF(ROW()<=COUNTA($A$1:$C$7), INDEX($C$1:$C$7, SMALL(IF($C$1:$C$7<>"", ROW($C$1:$C$7), ""), ROW()-COUNTA($A$1:$B$7))), "")))


...confirm that formula by pressing CTRL+SHIFT+ENTER to activate the array. You will know the array is active when curly braces { } appear around your formula.

Now copy D1 downward.

2014-09-12_0909 - JerryBeaucaire's library
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,598
Messages
5,832,646
Members
430,150
Latest member
amitk1

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
Top