![]() |
Sort by last 2 digits
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? |
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 "mbparks" wrote: 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? |
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 -----Original Message----- 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? . |
Actually, the returned value will be a text string. The
formula won't drop the zero. Jason -----Original Message----- 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 "mbparks" wrote: 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? . |
Thanks millions and millions to all...
"mbparks" wrote: 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? |
All times are GMT +1. The time now is 04:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com