Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Melissa
 
Posts: n/a
Default Column sorting incorrectly

I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?
  #2   Report Post  
RWN
 
Posts: n/a
Default

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?



  #3   Report Post  
Melissa
 
Posts: n/a
Default

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?




  #4   Report Post  
RWN
 
Posts: n/a
Default

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.


Not necessarily. If a text value is already present then selecting the cell and changing
the format won't have any effect (try it).
To force the format to a number, select a blank cell and copy it. Then select the range
where you require the format to be numeric and "PasteSpecial-Add".


--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank

rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?






  #5   Report Post  
Melissa
 
Posts: n/a
Default

I checked the format of the "errant" cells and it shows Number too.

In future, how will I know that there's an "underlying" text format if I
can't see it in the FormatCell menu? It so happens I noticed the problem in
this spreadsheet, which is also a small file.

BTW, I did the pasteSpecial Add and my column is sorting correctly now.
Can you please explain what this "Add" operation does?

Many thanks.

"RWN" wrote:

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.


Not necessarily. If a text value is already present then selecting the cell and changing
the format won't have any effect (try it).
To force the format to a number, select a blank cell and copy it. Then select the range
where you require the format to be numeric and "PasteSpecial-Add".


--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank

rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?








  #6   Report Post  
Melissa
 
Posts: n/a
Default

Oh, and why won't Format Painter work? I thought it's to apply the format to
the new cells?

"RWN" wrote:

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.


Not necessarily. If a text value is already present then selecting the cell and changing
the format won't have any effect (try it).
To force the format to a number, select a blank cell and copy it. Then select the range
where you require the format to be numeric and "PasteSpecial-Add".


--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank

rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?






  #7   Report Post  
Max
 
Posts: n/a
Default

"Melissa" wrote:
.. I expect that when I select my whole column
and format cells to Number, that
all the selected cells WILL have the format: Number.


Think formatting doesn't change the underlying ..

Try this:

Copy an empty cell, then select the range of 40 numbers
Right-click paste special Check "Add" OK

Now the 40 numbers should sort properly
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #8   Report Post  
Stefi
 
Posts: n/a
Default

What is the source of these data? I experienced earlier that imported data
(e.g. from a text file) behave like that!

Stefi


"Melissa" wrote:

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?




  #9   Report Post  
Melissa
 
Posts: n/a
Default

Yes, the values were imported. But the question is: why after formatting the
cells to Number, are they still not behaving the way they should?

"Stefi" wrote:

What is the source of these data? I experienced earlier that imported data
(e.g. from a text file) behave like that!

Stefi


"Melissa" wrote:

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?



  #10   Report Post  
Stefi
 
Posts: n/a
Default

In my opinion it's an Excel bug. I found a workaround: format a new helper
column as number, copy your misbehaving column and paste special values in
the helper column. Try to sort by it and if it is correct, you may copy it
back in its original place if necessary.

Regards,
Stefi


"Melissa" wrote:

Yes, the values were imported. But the question is: why after formatting the
cells to Number, are they still not behaving the way they should?

"Stefi" wrote:

What is the source of these data? I experienced earlier that imported data
(e.g. from a text file) behave like that!

Stefi


"Melissa" wrote:

I expect that when I select my whole column and format cells to Number, that
all the selected cells WILL have the format: Number.

In response to your question on breaks, my spreadsheet does not contain any
empty rows although somes cells may be blank.

I selected all the relevant rows and columns before applying auto-filter.

A bit more info on this column that I am sorting: this column contains
numbers 1-40 plus some blank cells.

"RWN" wrote:

Are you absolutely sure of the format? Sounds like the errant values are text.

Also, are the rows contiguous (i.e. no breaks)? If there is an empty row and you click
sort it will select the current region which is determined by where xl finds blank rows
and columns.
To be sure, select the values and then sort.

HTH
--
Regards;
Rob
------------------------------------------------------------------------
"Melissa" wrote in message
...
I have a column containing numbers 1-40. I made sure the format of these
cells is "Number" then I sorted my spreadsheet in ascending order. The
strange thing is, the order is correct except that 19, 35, 36, 38, 39 appear
after 40. Why is this happening?





  #11   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 11 Oct 2005 23:15:03 -0700, "Melissa"
wrote:

Yes, the values were imported. But the question is: why after formatting the
cells to Number, are they still not behaving the way they should?


You are confusing cell format with cell contents. They are really two
different things.

Changing the format of a cell does not change its contents.

If you have already entered TEXT into a cell, changing the format does not
change the nature of the Value that is stored.

For many operations, Excel will give you the option of treating TEXT that looks
like numbers, as numbers. You should get that option using the Data/Sort
wizard (at least in versions 2002 and subsequent; I can't recall about before
then).

There are several ways to tell the difference. You can use the formula
=ISTEXT(cell_ref); if you have not changed the default justification, TEXT
will be left-justified and numbers will be right-justified.


--ron
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
Right column doesn't change when sorting left column. nohope Excel Discussion (Misc queries) 2 July 19th 05 03:27 PM
Lookup Table Dilemma Karen Excel Worksheet Functions 2 June 10th 05 08:22 PM
How to group similar column titles together???? vrk1 Excel Discussion (Misc queries) 2 April 30th 05 12:17 AM
Subtotal results in new column and then sorting subtotals ArtM Excel Worksheet Functions 1 January 18th 05 12:21 AM
How can I sort an entire spreadsheet from a list prod sorter Excel Worksheet Functions 4 November 17th 04 03:43 AM


All times are GMT +1. The time now is 02:23 AM.

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"