How do I sort alphabetically by last letter in Excel?

G

Guest

I have a pile of email addresses and i would like to go through them ordered
by company to see how many we have from each company and see who we have of
interest in our list? the list is ordered alphabetically and i would like it
remain ordered alphabetically but in the style of a rhyming dictionary ie
last letter given highest priority and the first letter the lowest. I am
suprised i couldnt find the answer in help because this is normally used for
lists of dates. ie put the year first, month second and day last then you
have from the date a numeric sequence corresponding to chronological order.
in summary i would like the list ordered alphabetically as if it were a
mirror image of itself. i use excel 2003. many thanks
 
B

Bob Phillips

You would need to write a UDF that extracts that cell, or that part of the
cell, that you want, reverse the text and return that reversed value into a
helper column. Then sort on that helper column.

Are you saying that if the email address is

(e-mail address removed)

it should revert to

moc.erehwemos@:em

?
 
N

Niek Otten

Easiest to introduce a helper column in which you put the reversed text, and
then sort both columns, using the helper column as sort key.

For the helper column:

Open the VB Editor (ALT+F11)
Insert>Module
Paste this code in the code window:

Function Reverse(Text)
Dim i As Long
Reverse = ""
For i = Len(Text) To 1 Step -1
Reverse = Reverse + Mid(Text, i, 1)
Next
End Function

Now you can use the Reverse function in your worksheet. If A1 contains abcd,
and you put =Reverse(A1) in B1, then B1 will be dcba

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
 
G

Guest

many thanks. that seems like the bizz. i suppose it takes away the glory a
bit but i am so useless with computers that i cant follow through on the good
advice you have given me untill someone can help me use the function
function figuratively speaking. good advice to a bad general. luckily my
girlfriends brother is now hear to help. i live in spain and will help you
for soemthing in the future if you want. i know about music and art and also
marketing of technology. thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top