#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Text Split

Hi,

I have 4000 line of data which is first and surnames combined e.g DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and surname,

thanks

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Text Split

Hi,

Lets say we have MarkSmith in A1.

Put this array formula in B1 to extract the first name. Note it's all one
line and see below for how to enter and array formula

=LEFT(A1,MATCH(0,TRANSPOSE(--EXACT(MID(A1,ROW(INDIRECT(2&":"&LEN(A1))),1),MID(L OWER(A1),ROW(INDIRECT(2&":"&LEN(A1))),1))),0))&""

And then this in c1 to get the second name

=MID(A1,LEN(B1)+1,LEN(A1))

This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.

Mike



"DDay" wrote:

Hi,

I have 4000 line of data which is first and surnames combined e.g DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and surname,

thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,420
Default Text Split

Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Dim i As Long, j As Long
Dim LastRow As Long

With ActiveSheet

LastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
For i = 1 To LastRow

For j = Len(.Cells(i, TEST_COLUMN).Value) To 2 Step -1

If Asc(Mid$(.Cells(i, TEST_COLUMN).Value, j, 1)) <= 90 Then

.Cells(i, TEST_COLUMN).Value = _
Left$(.Cells(i, TEST_COLUMN).Value, j - 1) & _
" " & Mid$(.Cells(i, TEST_COLUMN).Value, j)
End If
Next j
Next i
End With

End Sub

--
__________________________________
HTH

Bob

"DDay" wrote in message
...
Hi,

I have 4000 line of data which is first and surnames combined e.g
DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and
surname,

thanks



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Text Split

With A1 having names try the below formulas...Its a bit lenghty to handle
names without last name...

B1
First name ()
=LEFT(A1,FIND(" ",A1 & " ")-1)

C1
Last name
=IF(ISERROR(FIND(" ",A1)),"",TRIM(RIGHT(SUBSTITUTE(A1," ",REPT("
",99)),99)))

If this post helps click Yes
---------------
Jacob Skaria


"DDay" wrote:

Hi,

I have 4000 line of data which is first and surnames combined e.g DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and surname,

thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Text Split

I misunderstood the query..Please ignore this post...
--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

With A1 having names try the below formulas...Its a bit lenghty to handle
names without last name...

B1
First name ()
=LEFT(A1,FIND(" ",A1 & " ")-1)

C1
Last name
=IF(ISERROR(FIND(" ",A1)),"",TRIM(RIGHT(SUBSTITUTE(A1," ",REPT("
",99)),99)))

If this post helps click Yes
---------------
Jacob Skaria


"DDay" wrote:

Hi,

I have 4000 line of data which is first and surnames combined e.g DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and surname,

thanks



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default Text Split

Also look at the responses you have got to your posting in another
newsgroup.

--
Regards
Roger Govier

"DDay" wrote in message
...
Hi,

I have 4000 line of data which is first and surnames combined e.g
DavidHill,
MarkSmith etc etc. I need a formula to divide these by the second capital
letter only to make David Hill, Mark Smith etc etc

All entries have a capital letter at the start of the forename and
surname,

thanks

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to split up text Hilton Excel Worksheet Functions 5 July 10th 08 11:50 AM
Split a text Manos Excel Worksheet Functions 7 October 17th 07 05:51 PM
Split text without using data-text to columns Jambruins Excel Discussion (Misc queries) 7 January 21st 06 02:16 PM
Split Text Gabe Excel Discussion (Misc queries) 6 January 4th 06 09:52 PM
text cells end page how split to next. Text lost! Elaine Excel Discussion (Misc queries) 1 August 28th 05 05:48 PM


All times are GMT +1. The time now is 06:36 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"