Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 10
Cool Sorting a column based on required order

Hi

Below is my requirement

I have 100 rows in a excel . I need to sort this rows based on column A .But this sorting is not ascending or in descending order .I need the sorting to be done by the order I mention

Eg:


Rows present in Excel



AAA 123
FFF 111
GGG 456
DDD 654
AAA 775
FFF 986
TTT 777


I need the Column A to be sorted in this order


DDD
TTT
AAA
FFF
GGG


Hence my output must be like this



DDD 654
TTT 777
AAA 123
AAA 775
FFF 986
FFF 986
GGG 456

Please let me know whether this can be achieved with excel macro or formulas.
  #2   Report Post  
Junior Member
 
Posts: 3
Default

I'm not sure this is the best approach, but it's what I know and it should work.



Presumably you have a limited number of values possible in column A.

If so, you could build an array in a seperate worksheet.

DDD 1
TTT 2
AAA 3
FFF 4
GGG 5

Then you could reference that array with =VLOOKUP(A:A,arraysheet!A:B,2,FALSE) in an extra column in your main sheet to generate a column to sort by.


AAA 123 3
FFF 111 4
GGG 456 5
DDD 654 1
AAA 775 3
FFF 986 4
TTT 777 2


Hope that helps.

Last edited by Hate-Excel-Need : April 19th 12 at 09:25 AM
  #3   Report Post  
Junior Member
 
Posts: 1
Thumbs up

Quote:
Originally Posted by Hate-Excel-Need View Post
I'm not sure this is the best approach, but it's what I know and it should work.



Presumably you have a limited number of values possible in column A.

If so, you could build an array in a seperate worksheet.

DDD 1
TTT 2
AAA 3
FFF 4
GGG 5

Then you could reference that array with =VLOOKUP(A:A,arraysheet!A:B,2,FALSE) in an extra column in your main sheet to generate a column to sort by.


AAA 123 3
FFF 111 4
GGG 456 5
DDD 654 1
AAA 775 3
FFF 986 4
TTT 777 2


Hope that helps.
Add a custom list:
for excel 2010:
Fille\Excel Options\Advanced\Edit Custom List
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
Sorting based on one column Meems Excel Discussion (Misc queries) 1 February 20th 09 06:51 PM
Sorting a table of data into one column in ascending order matt3542 Excel Programming 5 September 2nd 08 08:44 AM
Sorting a Column in ascending order in excel vba yogeshyl Excel Programming 2 December 12th 07 07:28 AM
Sorting a column with numbers into descending order wardle86 Excel Programming 2 October 4th 07 06:58 PM
sorting column order Brotherwarren Excel Programming 0 September 25th 07 08:37 AM


All times are GMT +1. The time now is 09:44 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"