![]() |
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. |
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. |
Quote:
for excel 2010: Fille\Excel Options\Advanced\Edit Custom List |
All times are GMT +1. The time now is 07:09 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com