Sort by last 2 digits

G

Guest

I would like to sort a column by the last 2 digits of the cell entry. The
entries will begin with 2 to 3 letters followed by 7 numeric digits. Example:
BY0123456.
I would like to sort using the 56. How can I accomplish this?
 
G

Guest

A simple solution would to add a column that contains the formula
=Right(OrigDataCellAddress,2), which returns the last two characters of the
original cell; Then sort on this new column.

The downside to this is that if the last 2 characters are numbers and the
second last character is a zero, then it will only return the last character,
because the returned value is a number. To overcome this, you would have to
use the Text() function.

Dan Knight
 
J

Jason Morin

Pull out the last 2 digits into a new column using:

=RIGHT(A1,2)

Then select all columns with data and sort based on this
new column.

HTH
Jason
Atlanta, GA
 
J

Jason Morin

Actually, the returned value will be a text string. The
formula won't drop the zero.

Jason
 

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