Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Isolate text immediately preceding "("

I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Isolate text immediately preceding "("

On Thu, 3 Jul 2008 10:51:02 -0700, Tacrier .
wrote:

I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina



=TRIM(LEFT(A1,FIND("(",A1)-1))

=MID(A1,FIND("(",A1),255)
--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Isolate text immediately preceding "("

Trina,

With your string in A1, enter this into B1

=LEFT(A1,FIND("(",A1)-2)

and this into C1 (format cell C1 as a date)
=--SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(MID(A1,FIND("(",A 1)+1,LEN(A1)),")",""),"DOB: ",""),"/",", ")

and then copy down to match your list.

Then copy and paste values to convert the formulas to values, and delete column A.

HTH,
Bernie
MS Excel MVP


"Tacrier" . wrote in message
...
I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Isolate text immediately preceding "("

Hi,

Name
=TRIM(LEFT(A1,FIND("(",A1,1)-1))

DOB
=TRIM(MID(A1,FIND("(",A1,1),LEN(A1)))

Mike

"Tacrier" wrote:

I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 171
Default Isolate text immediately preceding "("

The number of characters left of the paren is just search("(",a1)-1. So use
the LEFT function rather than mid, keeping that many characters. I'd also
apply the TRIM function to remove leading and trailing spaces:
=trim(left(a1,search("(",a1)-1))
The piece beginning with the paren would be similar, but calculate the
number of characters as len(a1)+1-search("(",a1) and use the RIGHT function.
Alternately, check out the Data Text to Columns, indicate that your data
is delimited by '('

"Tacrier" wrote:

I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina



  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Isolate text immediately preceding "("

Assuming you want to pull out the DOB and convert it into a real Excel
date...

=--SUBSTITUTE(SUBSTITUTE(TRIM(RIGHT(A1,10)),")",""),"/",", ")

Rick


"Tacrier" . wrote in message
...
I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths
due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina




  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Isolate text immediately preceding "("

Thank you to everyone that replied! The Left and Mid functions worked great!!

:)

"Sandy Mann" wrote:

For Smith, John
=LEFT(A1,FIND("(",A1)-1)

For (DOB: Dec 16/91)
=MID(A1,SEARCH("(",A1),255)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings


Replace @mailinator.com with @tiscali.co.uk


"Tacrier" . wrote in message
...
I tried unsuccessfully to isolate text immediately preceding the "(" from a
text string into another cell using:

=MID(A1,SEARCH("(",A1) -20)

My text string contains a payee name followed by their date of birth like
this:

Smith, John (DOB: Dec 16/91)

I want to put the name into cell A1 and the DOB into B1, however I want to
do this for about 100 rows and each row has different text string lengths
due
to the varying name lengths.

Any suggestions?

Thanking you in advance,
Trina







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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
how i convert "100" to "hundred"( number to text) in excel-2007 mohanraj Excel Worksheet Functions 1 May 11th 08 09:07 PM
Excel "Getting Started" immediately goes away Joe M Excel Discussion (Misc queries) 2 January 27th 08 10:02 PM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Insert "-" in text "1234567890" to have a output like this"123-456-7890" Alwyn Excel Discussion (Misc queries) 3 October 25th 05 11:36 PM


All times are GMT +1. The time now is 08:54 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"