Separation of compound names, within the name

shimaa01234

Active Member
Joined
Jun 24, 2014
Messages
446
Can you separate the compound names in Arabic
Such as:
Abdel Rahman, Abdel Massih
Using the formula
Separation of compound names, within the name,
Name the compound so that, in a single column
And the rest, all in the name of a separate column
Like this table

Mohammed Abdel Rahman BayoumiMohammedAbdel RahmanBayoumi
Abdel Rahim Mustafa Tayeb Abdel RahimMustafaTayeb
Elias Abdel Massih CharlesEliasAbdel MassihCharles

<tbody>
</tbody>
 
Last edited:
First - I'm sorry for your trouble
Secondly - the expected result is:
Abd Elrahman Abd Elaziz Mohammed IbrahimAbd ElrahmanAbd ElazizMohammedIbrahim


These two formulas changed:

C1:
=IF(LEFT(TRIM(SUBSTITUTE(A1,B1,"")),FIND(" ",TRIM(SUBSTITUTE(A1,B1,"")))-1)<>"Abd",LEFT(TRIM(SUBSTITUTE(A1,B1,"")),FIND(" ",TRIM(SUBSTITUTE(A1,B1,"")))-1),TRIM(LEFT(SUBSTITUTE(TRIM(SUBSTITUTE(A1,B1,""))," ",REPT(" ",99)),198)))

D1:
=IF(ISNUMBER(FIND("Abd",TRIM(SUBSTITUTE(A1,B1&" "&C1&" ","")))-1),TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(A1,B1&" "&C1&" ","")," ",REPT(" ",99)),198)),TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(A1,B1&" "&C1&" ","")," ",REPT(" ",99)),99)))
Excel Workbook
ABCDE
1Abd Rahman Samir AliAbd RahmanSamirAli
2Abd Allah Ibrahim MarzoukiAbd AllahIbrahimMarzouki
3Samira Syed Abd ElMominSamiraSyedAbd ElMomin
4Alaa ElDin Mohamed AliAlaa ElDinMohamedAli
5Peter Michel Abd ElMassihPeterMichelAbd ElMassih
6Abd Elaziz Ibrahim Abd ElrahmanAbd ElazizIbrahimAbd Elrahman
7Abd Elaziz Ibrahim Abd Elrahman MohammedAbd ElazizIbrahimAbd ElrahmanMohammed
8Abd ElRahman Abd ElAziz Mohammed IbrahimAbd ElRahmanAbd ElAzizMohammedIbrahim
Sheet
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You are a wonderful
All words of thanks, not enough to express my thanks to you
You are a wonderful person
Thank you
Everything works wonderfully
 
Upvote 0
P.S.

Continuous adapting to newer and newer name structures has made the formulas longer and longer. Now, looking through the name patterns available, easier processing methods come to mind. One of them may be the following:

(If you want to keep the names in their original form, copy/past them into another column, for example, if you want to create a table like the one in post #31, copy/paste colum A to column B.)

Select the names to process
Go to Edit/Replace and replace all „ „ with „;” (that is, replace space with semicolon) ( without the quotation marks)
Then replace all „Abd;” with „Abd „ (Abd and space) and if Alaa has the same function in the names as Abd then also replace all „Alaa;” with „Alaa „ (Alaa and space)
Go to Data/Text to Columns and check „Delimited” radio button then click „Next”
In the next window check „Semicolon” and click „Finish”
 
Upvote 0
Thank you very much Mr. "Istvan"
In order to, this information
But, I'm sorry
Formulas actually work well
But there are some names, do not work well without repeating space before
Like this:
Mahmoud Khalifa Abd ELLatif Abd elBary
Shows like that:
Mahmoud Khalifa Abd ELLatif Abd elBaryMahmoudKhalifaAbdELLatif Abd elBary

<colgroup><col width="296"><col width="85"><col width="71"><col width="94"><col width="146"></colgroup><tbody>
</tbody>



<colgroup><col width="296"></colgroup><tbody>
</tbody>
 
Upvote 0
@shimaa01234
Please check your Private Messages
 
Upvote 0
Thank you very much Mr. "Istvan"
In order to, this information
But, I'm sorry
Formulas actually work well
But there are some names, do not work well without repeating space before
Like this:
Mahmoud Khalifa Abd ELLatif Abd elBary
Shows like that:
Mahmoud Khalifa Abd ELLatif Abd elBaryMahmoudKhalifaAbdELLatif Abd elBary



Formulas in post #31 will be discontinued, as they have become too long, too hard to further develop.
The good news is that the new name can be processed correctly by the method described in post #34, supposing Mahmoud*Kalifa*Abd Ellatif*Abd elbary is the correct separation.

Also, the macro below gives the same result (inserting macros is described in many posts on these pages):

Code:
Sub Sepnames()
Dim c As Range
Dim lc, uc As String
'For example:
lc = "a21"   'First cell
uc = "a29"   'Last cell
        For Each c In ActiveSheet.Range(lc, uc)
          c.Offset(, 1) = Replace(Replace(Replace(c, " ", ";"), "Abd;", "Abd "), "Alaa;", "Alaa ")
        Next
    Application.DisplayAlerts = False
    Range(lc, uc).Offset(, 1).Select
    Selection.TextToColumns Destination:=Range(lc).Offset(, 1), DataType:=xlDelimited, _
    semicolon:=True
    Application.DisplayAlerts = True
End Sub
Excel Workbook
ABCDE
21Abd Rahman Samir AliAbd RahmanSamirAli
22Abd Allah Ibrahim MarzoukiAbd AllahIbrahimMarzouki
23Samira Syed Abd ElMominSamiraSyedAbd ElMomin
24Alaa ElDin Mohamed AliAlaa ElDinMohamedAli
25Peter Michel Abd ElMassihPeterMichelAbd ElMassih
26Abd Elaziz Ibrahim Abd ElrahmanAbd ElazizIbrahimAbd Elrahman
27Abd Elaziz Ibrahim Abd Elrahman MohammedAbd ElazizIbrahimAbd ElrahmanMohammed
28Abd ElRahman Abd ElAziz Mohammed IbrahimAbd ElRahmanAbd ElAzizMohammedIbrahim
29Mahmoud Khalifa Abd ELLatif Abd elBaryMahmoudKhalifaAbd ELLatifAbd elBary
Sheet
 
Upvote 0
Excellent code, Mister "Istvan"
But I was, preferred formula
Because I can be used better
 
Last edited:
Upvote 0
Excellent code, Mister "Istvan"
But I was, preferred formula
Because I can be used better


If using formula is preferred, give this a try. To make it a bit more comfortable, enter this formula in B1 and just copy down and right as long as there are names (if there are many rows, just click on the filling plus appearing in the right bottom corner of B1). Hope this will work even if further names are added of the similar structure.

=SUBSTITUTE(TRIM(MID(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(" "&$A1,"Abd ","Abd,"),"Alaa ","Alaa,")," ",REPT(" ",99)),COLUMN(A$1)*99,99)),","," ")

(Result as in post #37)
 
Upvote 0
Yes, you did it
You are really wonderful
Thank you very much that I wanted from the beginning
Has been achieved
Thank you very much
 
Upvote 0

Forum statistics

Threads
1,216,238
Messages
6,129,654
Members
449,526
Latest member
hmoh

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