View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Can you sort a column by text going right to left?

On Wed, 7 Dec 2005 18:24:02 -0800, "luvsdogz"
wrote:

I am trying to sort a by column, but want the sort to start with the right
side of the column-for example
1234gk-want to sort by kg4321 or really just gk, but I thought I could get
right to left easier.
I don't want to go thru the whole sheet to delete the numbers


Are all the sort keys the same length?

In other words, are there always 6 characters?

If that is the case, then you could use worksheet formulas to generate the
reverse of the number in an adjacent column, and then sort on that reversed
column.

For example:

=CONCATENATE(RIGHT(A1,1),MID(A1,5,1),MID(A1,4,1),M ID(A1,3,1),MID(A1,2,1),LEFT(A1,1))

If there is more variability, the approach could be similar, but with testing
for the length of the string.


--ron