ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Help with sorting.. (https://www.excelbanter.com/excel-discussion-misc-queries/49143-help-sorting.html)

johncu

Help with sorting..
 

Hi guys, first time here, hope someone can help.

I had a sheet that had names entered in column A, going in order of
surname, eg:
John Adams
Simon Allison
James Baker
Tessa Cunningham
etc...

I messed up a sort and then sorted by column A again to get it back in
alphabetical order, forgetting it would sort by the first names! So now
it reads:

James Baker
John Adams
Simon Allison
Tessa Cunningham.

Does anyone know how i can sort it back by the second word in Column
A??


--
johncu
------------------------------------------------------------------------
johncu's Profile: http://www.excelforum.com/member.php...o&userid=27908
View this thread: http://www.excelforum.com/showthread...hreadid=474048


Stefi

I'm afraid, you have to create a helper column to reverse the order of first
names and surnames with this formula:
=MID(A1,SEARCH(" ",A1)+1,99)&LEFT(A1,SEARCH(" ",A1)-1)
fill it down as necessary, and sort by this helper column

Take care! this formula works only if there is two words separated by one
space. In a more complicated case you need a more complicated formula!

Regards,
Stefi

€˛johncu€¯ ezt Ć*rta:


Hi guys, first time here, hope someone can help.

I had a sheet that had names entered in column A, going in order of
surname, eg:
John Adams
Simon Allison
James Baker
Tessa Cunningham
etc...

I messed up a sort and then sorted by column A again to get it back in
alphabetical order, forgetting it would sort by the first names! So now
it reads:

James Baker
John Adams
Simon Allison
Tessa Cunningham.

Does anyone know how i can sort it back by the second word in Column
A??


--
johncu
------------------------------------------------------------------------
johncu's Profile: http://www.excelforum.com/member.php...o&userid=27908
View this thread: http://www.excelforum.com/showthread...hreadid=474048



sevil_gp


Highlight the name column and split it into two columns (selecting
datatext to columns). Choose delimited data and select 'space' as the
delimiter.

Sort both columns by surname and then merge the two back together
(Although I'd leave them separate to avoid the same problem).

Garry


--
sevil_gp
------------------------------------------------------------------------
sevil_gp's Profile: http://www.excelforum.com/member.php...o&userid=27905
View this thread: http://www.excelforum.com/showthread...hreadid=474048



All times are GMT +1. The time now is 09:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com