remove . and @ then split name into 2 col

Trevor3007

Well-known Member
Joined
Jan 26, 2017
Messages
667
Office Version
  1. 365
Platform
  1. Windows
Hi,

Within a range ( a1..a500)I need to place the first name & surname in to retrospective columns . Below is an example

Billy.twoshoes1234@sole.uk

I need to remove the . , number & @sole.uk .

First namesurname
billy twoshoes

<tbody>
</tbody>

Then have the 1st name in one col & the surname in another ( as shown above).



Although I can get the first name via ‘ =LEFT(X2, FIND(".", X2&"?")-1) ‘, I cannot get the surname?

Can anyone sort this issue for me?

Many thanks in advance…..

KR
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Is the surname always followed by 4 digits and @?
 
Upvote 0
Trevor3007, Good afternoon.

Try to use:


First name --> =LEFT(A1, SEARCH(".", A1)-1)

Surname --> =MID(A1, SEARCH(".", A1)+1, SEARCH({1\2\3\4\5\6\7\8\9\0},A1)-(SEARCH(".", A1)+1))

Is that what you want?
I hope it helps.

Marcílio Lobão
 
Upvote 0
First, in your workbook's VBA in a Standard module paste in the following UDF (User Defined Function):

Code:
Function Getnum(inpt As String)
     Dim i As Integer
     For i = 1 To Len(inpt)
         If IsNumeric(Mid(inpt, i, 1)) Then
             Getnum = i
             Getnum = CLng(Getnum)
         Exit Function
         End If
     Next i
     Getnum = CLng(Getnum)
End Function


Excel 2010
ABCDE
2
3Billy.twoshoes1234@sole.uk15<< The UDF provides you with the Character # of the FIRST Numeric.
4
5>>>> HERE YOU GO !!! >>>>>BillyTwoshoes

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C3=Getnum(B3)
C5=LEFT($B3,FIND(".",B3,1)-1)
D5=Proper(MID($B3,FIND(".",$B3)+1,Getnum($B3)-FIND(".",$B3)-1))

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0

Excel 2010
ABC
1Billy.twoshoes1234@sole.ukBillytwoshoes
Sheet1
Cell Formulas
RangeFormula
B1=LEFT(A1,FIND(".",A1&".")-1)
C1=REPLACE(LEFT(A1,MIN(FIND({1,2,3,4,5,6,7,8,9,0},A1&"1234567890"))-1),1,LEN(B1)+1,"")
 
Upvote 0
Thank you all for your help and because of this help, my problem is resolved. thank you all again.

KR

Trevor3007
 
Upvote 0

Forum statistics

Threads
1,216,360
Messages
6,130,175
Members
449,562
Latest member
mthrasher16

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