Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 60
Default Condense out blanks in a list

Say I have a list like the following:

Red
Blue
Green
(blank cell)
Yellow
(blank cell)
Orange
(blank cell)
(blank cell)
Brown

Is there a function I can use (not a filter) that will create a new
list with blanks removed:

Red
Blue
Green
Yellow
Orange
Brown

Any ideas?

Thanks,
Matt

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Condense out blanks in a list

One way...

Assume your data is in the range A1:A10. The "blank" cells are *EMPTY*
cells.

Try this array formula** :

=IF(ROWS($1:1)<=COUNTA(A$1:A$10),INDEX(A$1:A$10,SM ALL(IF(A$1:A$10<"",ROW(A$1:A$10)-MIN(ROW(A$1:A$10))+1),ROWS($1:1))),"")

Copy down until you get *BLANKS*.

For some, me included, there is a difference between a blank cell and an
empty cell. An empty cell is just that, a cell that contains nothing at all.
A blank cell *can* mean a cell that contains a formula that returns an empty
text string. This is commonly known as a formula blank. the cell looks empty
but it's not because it contains a formula. This is an important
distinction. For example, the above formula will not work properly if the
cells contain formula blanks. This modified version will handle both empty
cells and cells with formula blanks:

Also an array formula** :

=IF(ROWS($1:1)<=ROWS(A$1:A$10)-COUNTBLANK(A$1:A$10),INDEX(A$1:A$10,SMALL(IF(A$1:A $10<"",ROW(A$1:A$10)-MIN(ROW(A$1:A$10))+1),ROWS($1:1))),"")

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"Matt" wrote in message
oups.com...
Say I have a list like the following:

Red
Blue
Green
(blank cell)
Yellow
(blank cell)
Orange
(blank cell)
(blank cell)
Brown

Is there a function I can use (not a filter) that will create a new
list with blanks removed:

Red
Blue
Green
Yellow
Orange
Brown

Any ideas?

Thanks,
Matt



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Condense out blanks in a list

Try this:

=IF(ISERR(SMALL(IF(Color<"",ROW(INDIRECT("1:"&ROW S(Color)))),ROWS($1:1))),"",INDEX(Color,SMALL(IF(C olor<"",ROW(INDIRECT("1:"&ROWS(Color)))),ROWS($1: 1))))

ctrl+shift+enter, not just enter
copy down as far as needed



"Matt" wrote:

Say I have a list like the following:

Red
Blue
Green
(blank cell)
Yellow
(blank cell)
Orange
(blank cell)
(blank cell)
Brown

Is there a function I can use (not a filter) that will create a new
list with blanks removed:

Red
Blue
Green
Yellow
Orange
Brown

Any ideas?

Thanks,
Matt


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Condense out blanks in a list

Hi Matt

One way.
Assuming your data is in column A.In column B enter 1 and 2 in B1 and B2,
Mark both cells and copy down for the extent of data in column A.
Mark columns A and BDataSortColumn A
All the blank rows will fall to the end
Delete all rows below your last entry in column A
Mark both columnsSortColumn B to return to original order.
Delete column B


--
Regards
Roger Govier



"Matt" wrote in message
oups.com...
Say I have a list like the following:

Red
Blue
Green
(blank cell)
Yellow
(blank cell)
Orange
(blank cell)
(blank cell)
Brown

Is there a function I can use (not a filter) that will create a new
list with blanks removed:

Red
Blue
Green
Yellow
Orange
Brown

Any ideas?

Thanks,
Matt



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condense list (remove blanks) socram Excel Worksheet Functions 2 March 10th 07 12:27 AM
clearing blanks in drop-down list Richard Walker Excel Discussion (Misc queries) 1 May 22nd 06 11:56 PM
How do I sort a list that contains blanks that I want to keep? SHexceluser Excel Discussion (Misc queries) 5 October 14th 05 10:27 PM
Vetical Filling blanks in a list morchard Excel Discussion (Misc queries) 3 June 30th 05 01:18 AM
validation list blanks Wes Excel Worksheet Functions 2 March 6th 05 08:01 PM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"