Sorting by last digits in cell

J

Julie

Hello,
I am trying to sort a column with hundreds of account numbers and would like
to sort by the last 4 digits instead of the first digits. Is there a way to
do this?
Any help would be appreciated!
Thank you.
 
G

Gary''s Student

Say the data is in column A. In B1 enter:


and copy down. Then sort cols A & B by B

For example:

856737 6737
236104 6104
825902 5902
221990 1990
991982 1982
267139 7139
307127 7127
549995 9995
762302 2302
194121 4121
172754 2754
200741 0741
365828 5828
538024 8024
483366 3366
178887 8887
716653 6653
646675 6675
283394 3394
371017 1017
791337 1337
863748 3748
707332 7332
976701 6701
515423 5423
390859 0859
640701 0701
601498 1498
495380 5380
654840 4840

will become:

640701 0701
200741 0741
390859 0859
371017 1017
791337 1337
601498 1498
991982 1982
221990 1990
762302 2302
172754 2754
483366 3366
283394 3394
863748 3748
194121 4121
654840 4840
495380 5380
515423 5423
365828 5828
825902 5902
236104 6104
716653 6653
646675 6675
976701 6701
856737 6737
307127 7127
267139 7139
707332 7332
538024 8024
178887 8887
549995 9995
 
J

Jacob Skaria

--Use a helper column to the right. Suppose you have data in ColA In cell B1
=RIGHT(A1,1)
and copy down..

--Select both columns sort by column B

If this post helps click Yes
 
D

Dave Peterson

In B1, enter:

=right(a1,4)
(to return the last 4 characters as text)
or
=--(right(a1,4)
(to return the last 4 characters (which must be numeric) as a real number
or
=mod(a1,10000)
(if the values are really numbers)
 

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