Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hugh Murfitt
 
Posts: n/a
Default Can I remove blanks from a range without using sort?

I have a range of cells A1:a10, say, which obtain data from another source.
Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
How do I reorder this range such that the cells containing information are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.
  #2   Report Post  
R.VENKATARAMAN
 
Posts: n/a
Default

this is

from one of the newsgroup correspondents

use this code statement

Range("a1:a10").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete



=================================

Hugh Murfitt wrote in message
...
I have a range of cells A1:a10, say, which obtain data from another

source.
Some of those cells a3, a6:a8, say, under certain conditions, will be

blank.
How do I reorder this range such that the cells containing information

are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.



  #4   Report Post  
Hugh Murfitt
 
Posts: n/a
Default

I was hoping for a formula that would re-order automatically without losing
data

"R.VENKATARAMAN" wrote:

this is

from one of the newsgroup correspondents

use this code statement

Range("a1:a10").SpecialCells(xlCellTypeBlanks).Ent ireRow.Delete



=================================

Hugh Murfitt wrote in message
...
I have a range of cells A1:a10, say, which obtain data from another

source.
Some of those cells a3, a6:a8, say, under certain conditions, will be

blank.
How do I reorder this range such that the cells containing information

are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.




  #5   Report Post  
Gord Dibben
 
Posts: n/a
Default

Hugh

What type of analysing are you doing on the data?

Most Functions will ignore blanks in a range.

=SUM(A1:A10) ignores the blanks.

To delete the blanks if desired..........

Select A1:A10 then F5SpecialBlanksOK

EditDeleteShift Up.


Gord Dibben Excel MVP



On Fri, 4 Mar 2005 03:43:03 -0800, Hugh Murfitt
wrote:

I have a range of cells A1:a10, say, which obtain data from another source.
Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
How do I reorder this range such that the cells containing information are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.




  #6   Report Post  
Hugh
 
Posts: n/a
Default

{=INDEX(A$1:A$10,SMALL(IF(A$1:A$10<0,ROW(A$1:A$10 ),""),ROW(A1:A1)))}
(control-shift-enter) will work if they are really blanks. If the
"blank" values are "" returned from elsewhere, they will remain "". If
0 is returned, they will be removed.
Note that your 1st reference must be to A1. Won't work if you use A2,
for example.

HTH



Hugh Murfitt wrote:
I have a range of cells A1:a10, say, which obtain data from another source.
Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
How do I reorder this range such that the cells containing information are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.

  #7   Report Post  
Hugh Murfitt
 
Posts: n/a
Default

This is EXACTLY what I wanted. Thanks a million for saving me a huge amount
of time.

"Hugh" wrote:

{=INDEX(A$1:A$10,SMALL(IF(A$1:A$10<0,ROW(A$1:A$10 ),""),ROW(A1:A1)))}
(control-shift-enter) will work if they are really blanks. If the
"blank" values are "" returned from elsewhere, they will remain "". If
0 is returned, they will be removed.
Note that your 1st reference must be to A1. Won't work if you use A2,
for example.

HTH



Hugh Murfitt wrote:
I have a range of cells A1:a10, say, which obtain data from another source.
Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
How do I reorder this range such that the cells containing information are
listed together, removing the blanks? I want to do this using a formula,
rather than filter or sort, as the data, and hence the blank cells, will
change, and I want to perform analysis on the cells containing data.


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
sumproduct of part cells of a range with blanks excelFan Excel Discussion (Misc queries) 4 February 25th 05 10:37 PM
Dynamic Print Range Help waxwing Excel Worksheet Functions 2 February 21st 05 03:47 PM
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
remove blanks from a string of chars within a cell? rayhollidge Excel Discussion (Misc queries) 3 January 8th 05 02:43 AM
How do i get an average that ignores blanks in the range of cells. ucastores Excel Worksheet Functions 7 November 11th 04 05:01 PM


All times are GMT +1. The time now is 05:41 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"