ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   sort by two columns ends up with wrong sort in 2nd col (https://www.excelbanter.com/excel-discussion-misc-queries/164460-sort-two-columns-ends-up-wrong-sort-2nd-col.html)

urbnjckct

sort by two columns ends up with wrong sort in 2nd col
 
I select Data Sort, select the two columns, yes to header row, and the sort
finishes but only partially correct. the first column sorts fine, and the
second almost sorts fine with one weird exception: there is a small part of
the 2nd column data that sorts through W and then starts again at A. I've
sorted by the 2nd column ONLY, and it sorts correctly. I've copied the data
range into another worksheet and the same problem occurs. there are no
leading spaces in the data, and it's all alpha.

Jim Thomlinson

sort by two columns ends up with wrong sort in 2nd col
 
The first column will be the primary sort. The second column is dependant on
the first column. If the value of column 1 changes then the sorting of column
2 will start over again. Perhaps you need to change which column sorts first
and which one second...
--
HTH...

Jim Thomlinson


"urbnjckct" wrote:

I select Data Sort, select the two columns, yes to header row, and the sort
finishes but only partially correct. the first column sorts fine, and the
second almost sorts fine with one weird exception: there is a small part of
the 2nd column data that sorts through W and then starts again at A. I've
sorted by the 2nd column ONLY, and it sorts correctly. I've copied the data
range into another worksheet and the same problem occurs. there are no
leading spaces in the data, and it's all alpha.


urbnjckct

sort by two columns ends up with wrong sort in 2nd col
 
hmm, maybe I wasn't clear... the values in the first sort column are last
names, and the values in the second sort column are titles of books written
by the people in the first column. the problem is that when I sort by 1. last
name and 2. title, I end up with this result:

smith A title
smith B title
smith J title
smith W title
smith A title
smith G title
smith K title

etc...

so I need to know why the sort of the second column starts over at that odd
point. I hope this was clearer. thanks.


"Jim Thomlinson" wrote:

The first column will be the primary sort. The second column is dependant on
the first column. If the value of column 1 changes then the sorting of column
2 will start over again. Perhaps you need to change which column sorts first
and which one second...
--
HTH...

Jim Thomlinson


"urbnjckct" wrote:

I select Data Sort, select the two columns, yes to header row, and the sort
finishes but only partially correct. the first column sorts fine, and the
second almost sorts fine with one weird exception: there is a small part of
the 2nd column data that sorts through W and then starts again at A. I've
sorted by the 2nd column ONLY, and it sorts correctly. I've copied the data
range into another worksheet and the same problem occurs. there are no
leading spaces in the data, and it's all alpha.


Pete_UK[_2_]

sort by two columns ends up with wrong sort in 2nd col
 
Are you sure there are no leading or trailing spaces in that second column?
Have you applied the TRIM or CLEAN functions to it and then fixed the
values? Perhaps you have some non-breaking space characters (char 160)
lurking around.

Hope this helps.

Pete

"urbnjckct" wrote in message
...
hmm, maybe I wasn't clear... the values in the first sort column are last
names, and the values in the second sort column are titles of books
written
by the people in the first column. the problem is that when I sort by 1.
last
name and 2. title, I end up with this result:

smith A title
smith B title
smith J title
smith W title
smith A title
smith G title
smith K title

etc...

so I need to know why the sort of the second column starts over at that
odd
point. I hope this was clearer. thanks.


"Jim Thomlinson" wrote:

The first column will be the primary sort. The second column is dependant
on
the first column. If the value of column 1 changes then the sorting of
column
2 will start over again. Perhaps you need to change which column sorts
first
and which one second...
--
HTH...

Jim Thomlinson


"urbnjckct" wrote:

I select Data Sort, select the two columns, yes to header row, and
the sort
finishes but only partially correct. the first column sorts fine, and
the
second almost sorts fine with one weird exception: there is a small
part of
the 2nd column data that sorts through W and then starts again at A.
I've
sorted by the 2nd column ONLY, and it sorts correctly. I've copied the
data
range into another worksheet and the same problem occurs. there are no
leading spaces in the data, and it's all alpha.





All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com