Quantcast
Channel: Active questions tagged worksheet-function - Super User
Viewing all articles
Browse latest Browse all 1191

How can I stack all non-blank cells from a column?

$
0
0

I am looking for a formula that will take all non-blank values in one column and stack them in another column.

Please see example below. Essentially I am trying to go from column A to B using a formula:

AB
1AppleApple
2Orange
3OrangeLemon
4LemonPear
5Banana
6
7Pear
8
9Banana

I have tried the following formula, but it seems to only replicate column A.

=IFERROR(INDEX($A$1:$A$9,SMALL(IF($A$1:$A$9<>"",ROW($A$1:$A$9)-ROW($A$1)+1),ROWS($A$1:$A1))),"")

Any ideas on how to tackle this?

UPDATE: turns out the formula above works fine. Column A was auto-generated using an IF formula where any false condition would return a " ". It should have been "".


Viewing all articles
Browse latest Browse all 1191

Trending Articles