Sorting full names

RonOliver

Board Regular
Joined
Aug 30, 2022
Messages
99
Office Version
  1. 365
Platform
  1. Windows
Hi guys!

I have the following formula:
=IFERROR(IF($G$6="Delete",LET(list,REDUCE(C4:C1000,'Test1'!$A$200:$ZZ$200,LAMBDA(s,r,SUBSTITUTE(s," "&r&" "," "))),ord,SORT(list),FILTER(ord,ord<>"")),LET(ord,SORT(C4:C1000),FILTER(ord,ord<>""))),"")

This formula sorts full names. However, if G6 has "Delete", it deletes all prepositions from the full names (in the cases of "de la Puebla", "della Casagrande" or "van der merwe"). All possible prepositions are located in Test1'!$A$200:$ZZ$200. After deleting them, it sorts the list without prepositions.

I need to create an additional parameter that says "Ignore", with a way to sort the list displaying the full names but not taking prepositions into account. Let me give you an example:
Pablo Jiménez and Pablo de la Puebla would be sorted as "Pablo de la Puebla" and "Pablo Jiménez". I need it to sort it as "Pablo Jiménez" and "Pablo de la Puebla". That is, sort without prepositions and articles but include them in the list to be displayed. Is this possible?

Thanks so much!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
How about
Excel Formula:
=LET(Data,C4:C1000,list,REDUCE(Data,Test1!$A$200:$ZZ$200,LAMBDA(s,r,SUBSTITUTE(s," "&r&" "," "))),ord,SORTBY(Data,list),IFERROR(IF($G$6="Delete",SORT(FILTER(list,list<>"")),IF(G6="Ignore",FILTER(ord,ord<>""),SORT(FILTER(Data,Data<>"")))),""))
 
Upvote 1
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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