Sorting a range on the last word

Mark McInerney

Active Member
Joined
Apr 4, 2012
Messages
288
Office Version
  1. 365
Platform
  1. Windows
Hi Folks - Thanks in advance for taking a look a this.

I have a range of data - is it possible to sort it by the last word?

Arunas Liktoravicius - 0002 - Shop/Carwash
Callum Hurley - 0028 - Shop/Carwash
Christian Stuart - 0026 - Shop/Carwash
Cian Merriman - 0034 - Shop/Carwash
Fang Li - 0035 - Deli
Fiona O Connor - 0009 - Manager/Supervisor
Karl O Connor - 0012 - Manager/Supervisor
Kate Hudson - 0013 - Shop/Carwash
Kenneth O Connor - 0014 - Manager/Supervisor
Krysztof Ignatowicz - 0015 - Shop/Carwash
Mindaugas Serva - 0017 - Shop/Carwash
Molly Wood - 0031 - Deli
Monika Gos - 0018 - Deli
Radoslaw Gawor - 0020 - Shop/Carwash
Ron Hall - 0022 - Shop/Carwash
Rory O Connell - 0033 - Shop/Carwash
Sara Orellana Olivera - 0023 - Deli
Waldemar Szut - 0024 - Cornelscourt
Waldemar Szut - 0024 - Shop/Carwash
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about
Fluff.xlsm
ABC
1
2Arunas Liktoravicius - 0002 - Shop/CarwashArunas Liktoravicius - 0002 - Shop/Carwash
3Callum Hurley - 0028 - Shop/CarwashCallum Hurley - 0028 - Shop/Carwash
4Christian Stuart - 0026 - Shop/CarwashChristian Stuart - 0026 - Shop/Carwash
5Cian Merriman - 0034 - Shop/CarwashCian Merriman - 0034 - Shop/Carwash
6Fang Li - 0035 - DeliKate Hudson - 0013 - Shop/Carwash
7Fiona O Connor - 0009 - Manager/SupervisorKrysztof Ignatowicz - 0015 - Shop/Carwash
8Karl O Connor - 0012 - Manager/SupervisorMindaugas Serva - 0017 - Shop/Carwash
9Kate Hudson - 0013 - Shop/CarwashRadoslaw Gawor - 0020 - Shop/Carwash
10Kenneth O Connor - 0014 - Manager/SupervisorRon Hall - 0022 - Shop/Carwash
11Krysztof Ignatowicz - 0015 - Shop/CarwashRory O Connell - 0033 - Shop/Carwash
12Mindaugas Serva - 0017 - Shop/CarwashWaldemar Szut - 0024 - Shop/Carwash
13Molly Wood - 0031 - DeliWaldemar Szut - 0024 - Cornelscourt
14Monika Gos - 0018 - DeliFang Li - 0035 - Deli
15Radoslaw Gawor - 0020 - Shop/CarwashMolly Wood - 0031 - Deli
16Ron Hall - 0022 - Shop/CarwashMonika Gos - 0018 - Deli
17Rory O Connell - 0033 - Shop/CarwashSara Orellana Olivera - 0023 - Deli
18Sara Orellana Olivera - 0023 - DeliFiona O Connor - 0009 - Manager/Supervisor
19Waldemar Szut - 0024 - CornelscourtKarl O Connor - 0012 - Manager/Supervisor
20Waldemar Szut - 0024 - Shop/CarwashKenneth O Connor - 0014 - Manager/Supervisor
Sheet5
Cell Formulas
RangeFormula
C2:C20C2=SORTBY(A2:A20,TEXTAFTER(A2:A20,{"/"," "},-1))
Dynamic array formulas.
 
Upvote 0
Fluff to the rescue...(again) - Thanks for looking at this - appreciated.

I'm treating the last word as one with no breaks or gaps - "Deli" is treated as "Shop/Carwash" - Can I use two Text afters and link to the second " - " value that is found and return the text after that?
 
Upvote 0
How about
Fluff.xlsm
ABC
1
2Arunas Liktoravicius - 0002 - Shop/CarwashWaldemar Szut - 0024 - Cornelscourt
3Callum Hurley - 0028 - Shop/CarwashFang Li - 0035 - Deli
4Christian Stuart - 0026 - Shop/CarwashMolly Wood - 0031 - Deli
5Cian Merriman - 0034 - Shop/CarwashMonika Gos - 0018 - Deli
6Fang Li - 0035 - DeliSara Orellana Olivera - 0023 - Deli
7Fiona O Connor - 0009 - Manager/SupervisorFiona O Connor - 0009 - Manager/Supervisor
8Karl O Connor - 0012 - Manager/SupervisorKarl O Connor - 0012 - Manager/Supervisor
9Kate Hudson - 0013 - Shop/CarwashKenneth O Connor - 0014 - Manager/Supervisor
10Kenneth O Connor - 0014 - Manager/SupervisorArunas Liktoravicius - 0002 - Shop/Carwash
11Krysztof Ignatowicz - 0015 - Shop/CarwashCallum Hurley - 0028 - Shop/Carwash
12Mindaugas Serva - 0017 - Shop/CarwashChristian Stuart - 0026 - Shop/Carwash
13Molly Wood - 0031 - DeliCian Merriman - 0034 - Shop/Carwash
14Monika Gos - 0018 - DeliKate Hudson - 0013 - Shop/Carwash
15Radoslaw Gawor - 0020 - Shop/CarwashKrysztof Ignatowicz - 0015 - Shop/Carwash
16Ron Hall - 0022 - Shop/CarwashMindaugas Serva - 0017 - Shop/Carwash
17Rory O Connell - 0033 - Shop/CarwashRadoslaw Gawor - 0020 - Shop/Carwash
18Sara Orellana Olivera - 0023 - DeliRon Hall - 0022 - Shop/Carwash
19Waldemar Szut - 0024 - CornelscourtRory O Connell - 0033 - Shop/Carwash
20Waldemar Szut - 0024 - Shop/CarwashWaldemar Szut - 0024 - Shop/Carwash
Sheet5
Cell Formulas
RangeFormula
C2:C20C2=SORTBY(A2:A20,TEXTAFTER(A2:A20," ",-1))
Dynamic array formulas.
 
Upvote 0
Hi Fluff - Genius as always...now look what you made me do...and it works! Many Thanks as always.

=SORTBY(UNIQUE(FILTER(Payroll_Employee_Name,(Payroll_Year=W2)*(Payroll_Week=AA2))),TEXTAFTER(UNIQUE(FILTER(Payroll_Employee_Name,(Payroll_Year=W2)*(Payroll_Week=AA2)))," ",-1))
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top