View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jose
 
Posts: n/a
Default Alpha-Numeric Sorting

Thanks Ron.
--
Regards


"Ron Rosenfeld" wrote:

On Mon, 5 Dec 2005 08:30:04 -0800, "Jose"
wrote:

The ascend sort return my list as:
EXCEL SORT WOULD PREFER THIS
R10-1 R1-1
R10-10L R1-2
R10-2 R10-1
R1-1 R10-2
R11-1 R10-10L
R1-2 R11-1
R12-1 R12-1

I would prefer the sort from the second column. The second column was
assembled manually.


If I understand you correctly, you want to sort numerically first by the
numbers that are between the "R" and the "-", and then by the numbers that are
after the "-". The latter numbers may, on occasion, be followed by a letter.

I would set up two "helper columns" in which you extract the sort keys.

If your data is in Column F, then

G1: =--MID(F1,2,FIND("-",F1)-2)
H1: =LOOKUP(9.99E+300,--MID(F1,FIND("-",F1)+1,ROW(INDIRECT("1:5"))))

Select the entire range to be sorted, in this case F1:H7, and select Data/Sort
and do an ascending sort first on column G and then on Column H.


--ron