Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Sort on last two digits of data

A sorting question.

I have a sheet of data A12:BC77. I would like to sort this on items in
column A. The problem is I need to order it by the last two digits of the
data in Column A. So say ZWE11 will come before AA77 and QW22 will come
before BB55 and so on. There is probably a simple answer but it is missing
me at the moment.

All I can think of is splitting out the last two digits into a new column
and sorting on that, then deleting that column once sorted but seems very
messy.

Any advice will be very gratefully received

--
with kind regards

Spike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Sort on last two digits of data

Hi Spike

If I had to write a macro for this task, it would work just as you
suggest to do manually.

Why not use column BD as helper column. Enter the formula below in
BD12 and copy it down to BD77.

=Right(A12,2)

Now select the entire table, sort on column BD, and hide the column
for future use. (You can sort on column BD even when it is hidden)

Hopes this helps.
....
Per


On 5 Feb., 18:51, Spike wrote:
A sorting question. *

I have a sheet of data A12:BC77. *I would like to sort this on items in
column A. *The problem is I need to order it by the last two digits of the
data in Column A. *So say ZWE11 will come before AA77 and QW22 will come
before BB55 and so on. *There is probably a simple answer but it is missing
me at the moment.

All I can think of is splitting out the last two digits into a new column
and sorting on that, then deleting that column once sorted but seems very
messy.

Any advice will be very gratefully received

--
with kind regards

Spike


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default Sort on last two digits of data

I would do what you said. Insert a column before Col. A. Then put this
formula in A12, "=RIGHT(B12, 2)". Copy the formula down to row 77. This
will put the last 2 characters of data from Col. B in Col. A. Then hide the
column. Now you can sort by Column A. This would be much easier than doing
it by code. Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"Spike" wrote:

A sorting question.

I have a sheet of data A12:BC77. I would like to sort this on items in
column A. The problem is I need to order it by the last two digits of the
data in Column A. So say ZWE11 will come before AA77 and QW22 will come
before BB55 and so on. There is probably a simple answer but it is missing
me at the moment.

All I can think of is splitting out the last two digits into a new column
and sorting on that, then deleting that column once sorted but seems very
messy.

Any advice will be very gratefully received

--
with kind regards

Spike

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Sort on last two digits of data

Thank you, that is what i have done in code but thought there must be a
neater way of doing it
--
with kind regards

Spike


"Ryan H" wrote:

I would do what you said. Insert a column before Col. A. Then put this
formula in A12, "=RIGHT(B12, 2)". Copy the formula down to row 77. This
will put the last 2 characters of data from Col. B in Col. A. Then hide the
column. Now you can sort by Column A. This would be much easier than doing
it by code. Hope this helps! If so, let me know, click "YES" below.
--
Cheers,
Ryan


"Spike" wrote:

A sorting question.

I have a sheet of data A12:BC77. I would like to sort this on items in
column A. The problem is I need to order it by the last two digits of the
data in Column A. So say ZWE11 will come before AA77 and QW22 will come
before BB55 and so on. There is probably a simple answer but it is missing
me at the moment.

All I can think of is splitting out the last two digits into a new column
and sorting on that, then deleting that column once sorted but seems very
messy.

Any advice will be very gratefully received

--
with kind regards

Spike

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I sort a list of numbers by the last 4 digits? Kristin S[_2_] Excel Discussion (Misc queries) 1 May 18th 09 07:29 PM
sort a cell by last two digits mi20chelle02 Excel Discussion (Misc queries) 4 January 14th 09 04:00 PM
How do I sort the last 3 digits first and then the first 4 digit?. aphriam Excel Worksheet Functions 2 April 22nd 07 03:28 AM
Sort by last 2 digits BER Excel Discussion (Misc queries) 2 January 11th 07 11:01 AM
Sort by last 2 digits mbparks Excel Worksheet Functions 4 February 17th 05 06:11 PM


All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"