Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Why is a descending sort putting blank cells first?

Hi,
running the following macro:
ActiveSheet.Unprotect
Range("B10:GJ89").Select
Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("BE1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveWindow.ScrollColumn = 38
End Sub

This macro is applied to sort collumn BE which has the following formula for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")

When activated, it puts all the blank cells at the top of the collumn before
all the cells with values in. (NB it has sorted these correctly though in
descending order)

Any ideas what`s wrong folks?
Thanks for your time.
RR1
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 320
Default Why is a descending sort putting blank cells first?

the cells contain "" which is a null string, not blank, and sorting
descending puts them first. Perhaps change the formula to return 0 and hide
zeros
either by formatting (General;General;)
or by not displaying the zero values -- option in Tools./Options/View or
equivalent in 2007 using Office Button.

"Romileyrunner1" wrote in message
...
Hi,
running the following macro:
ActiveSheet.Unprotect
Range("B10:GJ89").Select
Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("BE1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveWindow.ScrollColumn = 38
End Sub

This macro is applied to sort collumn BE which has the following formula
for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")

When activated, it puts all the blank cells at the top of the collumn
before
all the cells with values in. (NB it has sorted these correctly though in
descending order)

Any ideas what`s wrong folks?
Thanks for your time.
RR1



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Why is a descending sort putting blank cells first?

Cheers Bob that makes sense.
As I have done before, If I use -999 as a default value (I have some
smallish negative #`s as values in the collumn), how do I phrase an average
of that column.

e.g. I want to say, "find the average of the cells in collumn BE that are
bigger than -900)
Any ideas Bob?
Thanks
RR1


"Bob Umlas" wrote:

the cells contain "" which is a null string, not blank, and sorting
descending puts them first. Perhaps change the formula to return 0 and hide
zeros
either by formatting (General;General;)
or by not displaying the zero values -- option in Tools./Options/View or
equivalent in 2007 using Office Button.

"Romileyrunner1" wrote in message
...
Hi,
running the following macro:
ActiveSheet.Unprotect
Range("B10:GJ89").Select
Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("BE1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveWindow.ScrollColumn = 38
End Sub

This macro is applied to sort collumn BE which has the following formula
for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")

When activated, it puts all the blank cells at the top of the collumn
before
all the cells with values in. (NB it has sorted these correctly though in
descending order)

Any ideas what`s wrong folks?
Thanks for your time.
RR1




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Why is a descending sort putting blank cells first?

You can use an array* formula, like this:

=AVERAGE(IF(BE1:BE100-900,BE1:BE100))

Adjust the ranges to suit your data.

* An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual <enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
edit the formula you will need to use CSE again.

Hope this helps.

Pete

On Sep 30, 8:13*pm, Romileyrunner1
wrote:
Cheers Bob that makes sense.
As I have done before, If I use -999 as a default value (I have some
smallish negative #`s as values in the collumn), how do I phrase an average
of that column.

e.g. I want to say, "find the average of the cells in collumn BE that are
bigger than -900)
Any ideas Bob?
Thanks
RR1



"Bob Umlas" wrote:
the cells contain "" which is a null string, not blank, and sorting
descending puts them first. Perhaps change the formula to return 0 and hide
zeros
either by formatting (General;General;)
or by not displaying the zero values -- option in Tools./Options/View or
equivalent in 2007 using Office Button.


"Romileyrunner1" wrote in message
...
Hi,
running the following macro:
ActiveSheet.Unprotect
* *Range("B10:GJ89").Select
* *Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo,
_
* * * *OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
* * * *DataOption1:=xlSortNormal
* * * *Range("BE1").Select
* *ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
* *ActiveWindow.ScrollColumn = 38
End Sub


This macro is applied to sort collumn BE which has the following formula
for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")


When activated, it puts all the blank cells at the top of the collumn
before
all the cells with values in. (NB it has sorted these correctly though in
descending order)


Any ideas what`s wrong folks?
Thanks for your time.
RR1- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 73
Default Why is a descending sort putting blank cells first?

Cheers Pete: works a treat.
Many thanks mate.
RR1

"Pete_UK" wrote:

You can use an array* formula, like this:

=AVERAGE(IF(BE1:BE100-900,BE1:BE100))

Adjust the ranges to suit your data.

* An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual <enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
edit the formula you will need to use CSE again.

Hope this helps.

Pete

On Sep 30, 8:13 pm, Romileyrunner1
wrote:
Cheers Bob that makes sense.
As I have done before, If I use -999 as a default value (I have some
smallish negative #`s as values in the collumn), how do I phrase an average
of that column.

e.g. I want to say, "find the average of the cells in collumn BE that are
bigger than -900)
Any ideas Bob?
Thanks
RR1



"Bob Umlas" wrote:
the cells contain "" which is a null string, not blank, and sorting
descending puts them first. Perhaps change the formula to return 0 and hide
zeros
either by formatting (General;General;)
or by not displaying the zero values -- option in Tools./Options/View or
equivalent in 2007 using Office Button.


"Romileyrunner1" wrote in message
...
Hi,
running the following macro:
ActiveSheet.Unprotect
Range("B10:GJ89").Select
Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo,
_
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Range("BE1").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveWindow.ScrollColumn = 38
End Sub


This macro is applied to sort collumn BE which has the following formula
for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")


When activated, it puts all the blank cells at the top of the collumn
before
all the cells with values in. (NB it has sorted these correctly though in
descending order)


Any ideas what`s wrong folks?
Thanks for your time.
RR1- Hide quoted text -


- Show quoted text -





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Why is a descending sort putting blank cells first?

You're welcome - thanks for feeding back.

Is that Romiley near Stockport?

Pete

On Oct 1, 6:47*am, Romileyrunner1
wrote:
Cheers Pete: works a treat.
Many thanks mate.
RR1



"Pete_UK" wrote:
You can use an array* formula, like this:


=AVERAGE(IF(BE1:BE100-900,BE1:BE100))


Adjust the ranges to suit your data.


* An array formula needs to be committed using the key combination of
Ctrl-Shift-Enter (CSE) rather than the usual <enter. If you do this
correctly then Excel will wrap curly braces { } around the formula
when viewed in the formula bar - do not type these yourself. If you
edit the formula you will need to use CSE again.


Hope this helps.


Pete


On Sep 30, 8:13 pm, Romileyrunner1
wrote:
Cheers Bob that makes sense.
As I have done before, If I use -999 as a default value (I have some
smallish negative #`s as values in the collumn), how do I phrase an average
of that column.


e.g. I want to say, "find the average of the cells in collumn BE that are
bigger than -900)
Any ideas Bob?
Thanks
RR1


"Bob Umlas" wrote:
the cells contain "" which is a null string, not blank, and sorting
descending puts them first. Perhaps change the formula to return 0 and hide
zeros
either by formatting (General;General;)
or by not displaying the zero values -- option in Tools./Options/View or
equivalent in 2007 using Office Button.


"Romileyrunner1" wrote in message
...
Hi,
running the following macro:
ActiveSheet.Unprotect
* *Range("B10:GJ89").Select
* *Selection.Sort Key1:=Range("BE10"), Order1:=xlDescending, Header:=xlNo,
_
* * * *OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
* * * *DataOption1:=xlSortNormal
* * * *Range("BE1").Select
* *ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
* *ActiveWindow.ScrollColumn = 38
End Sub


This macro is applied to sort collumn BE which has the following formula
for
each cell:
=IF(COUNT(DA10,BY10)=2,DA10-BY10,"")


When activated, it puts all the blank cells at the top of the collumn
before
all the cells with values in. (NB it has sorted these correctly though in
descending order)


Any ideas what`s wrong folks?
Thanks for your time.
RR1- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
avoid Descending Sort putting error cells uppermost in collumn Romileyrunner1 Excel Worksheet Functions 3 August 26th 09 02:41 PM
Putting subtotals in $ descending order Ms. Domzalski Excel Worksheet Functions 1 December 6th 07 01:14 AM
Ascending Sort formula, change to neg #: descending sort.. nastech Excel Discussion (Misc queries) 6 July 2nd 07 11:00 PM
putting a (.) period in blank cells when pasting data nospam Excel Worksheet Functions 8 December 19th 06 01:20 AM
Sort cells with same text descending T-DHM Excel Discussion (Misc queries) 1 January 6th 06 10:20 PM


All times are GMT +1. The time now is 12:38 AM.

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

About Us

"It's about Microsoft Excel"