ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   sorting problem (https://www.excelbanter.com/excel-programming/324814-sorting-problem.html)

Orion[_2_]

sorting problem
 
Hello,

is it somehow possible to sort something like this:

37/05
39/05
147/03
44/05
48/05
264/04
42/05
41/05
43/05
45/05
41/04
47/05
251/04
258/04
46/05
42/05

The 2 digit to the right of the slash is the year
The digits to the left of the slash are consecutive numbers, starting
with "1" for each year.

Can this be sorted, so that the last entry is on top and the first
entry is at the bottom?

Thanks for any help

Regards,
Norbert

david mcritchie

sorting problem
 
I'm sure I've misunderstood the question because you tried to
describe what the data is, but the only question I see is turning
the list upside down.

B1: 1 B2: 2 use the fill handle to copy down,
sort the entire sheet on column B descending.

If you want a macro to reverse only those cells (top to bottom), see
http://www.mvps.org/dmcritchie/excel/join.htm#reversi
It actually reverses any rectangular selection.

--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Orion" wrote in message ...
Hello,

is it somehow possible to sort something like this:

37/05
39/05
147/03
44/05
48/05
264/04
42/05
41/05
43/05
45/05
41/04
47/05
251/04
258/04
46/05
42/05

The 2 digit to the right of the slash is the year
The digits to the left of the slash are consecutive numbers, starting
with "1" for each year.

Can this be sorted, so that the last entry is on top and the first
entry is at the bottom?

Thanks for any help

Regards,
Norbert




Mike Fogleman

sorting problem
 
Use Text to Columns with "/" as the delimiter. You can now sort both columns
descending by year and descending by entry number. Concatenate the sorted
columns back together with the "/" in between columns. =Concatenate(columnB
& / & columnC).

Mike F
"Orion" wrote in message
...
Hello,

is it somehow possible to sort something like this:

37/05
39/05
147/03
44/05
48/05
264/04
42/05
41/05
43/05
45/05
41/04
47/05
251/04
258/04
46/05
42/05

The 2 digit to the right of the slash is the year
The digits to the left of the slash are consecutive numbers, starting
with "1" for each year.

Can this be sorted, so that the last entry is on top and the first
entry is at the bottom?

Thanks for any help

Regards,
Norbert




No Name

sorting problem
 
One way is to create helper columns from the data. Assume
that the data is in column A then compute column for the
numerical sequence using.....

=VALUE(MID(A2,1,FIND("/",A2)-1))

then compute a column for the year using....

=RIGHT(A2,2)

then if you sort on the YEAR (descending) and the SEQUENCE
(descending) it will sort ok.

Cheers
Nigel

-----Original Message-----
Hello,

is it somehow possible to sort something like this:

37/05
39/05
147/03
44/05
48/05
264/04
42/05
41/05
43/05
45/05
41/04
47/05
251/04
258/04
46/05
42/05

The 2 digit to the right of the slash is the year
The digits to the left of the slash are consecutive

numbers, starting
with "1" for each year.

Can this be sorted, so that the last entry is on top and

the first
entry is at the bottom?

Thanks for any help

Regards,
Norbert
.


Orion[_2_]

sorting problem
 
Hi David,

I do not understand what you mean with turning the list upside down.
It is not sorted yet.
Anyway, thanks for your help.

Norbert



On Tue, 8 Mar 2005 06:26:09 -0500, "David McRitchie"
wrote:

I'm sure I've misunderstood the question because you tried to
describe what the data is, but the only question I see is turning
the list upside down.

B1: 1 B2: 2 use the fill handle to copy down,
sort the entire sheet on column B descending.

If you want a macro to reverse only those cells (top to bottom), see
http://www.mvps.org/dmcritchie/excel/join.htm#reversi
It actually reverses any rectangular selection.



david mcritchie

sorting problem
 
Hi Norbert,
Upside down is self explanatory (reversed) 1,77,14 -- 14, 77, 1

Since the other solutons that separated at the slash and sorted
on two columns didn't answer your question either (or did they),
then I have no idea of show you want the data sorted and what
the "1" has to do with anything. In other words what is the data
shown supposed to look like once "sorted".
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm

"Orion" wrote in message
I do not understand what you mean with turning the list upside down.
It is not sorted yet.
Anyway, thanks for your help.





All times are GMT +1. The time now is 12:34 PM.

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