Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default extract cusotmer name from test string

I have long string of text that start with customer name. Immediately after
the text string, it populates either the schedule # (which start with "sch")
or master lease agreement # (start with "MLA"). I want to exract only the
customer name from it. What will be my formula? Below is a two typical
example.

A) ABC corp MLA 12667 MMA50-014-0 BSC-73081
B) Black and Decker SCH 303A4 SCH 3A61-COR BSC-15701

Thanks,
Dinesh

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,696
Default extract cusotmer name from test string

May want to use something like this:

=IF(ISERROR(FIND(" MLA ",A1)),LEFT(A1,FIND(" SCH ",A1)-1),LEFT(A1,FIND(" MLA
",A1)-1))

I entered space before and after in the find string to avoid capturing
companies that may have MLA or SCH within the name...

"Dinesh" wrote:

I have long string of text that start with customer name. Immediately after
the text string, it populates either the schedule # (which start with "sch")
or master lease agreement # (start with "MLA"). I want to exract only the
customer name from it. What will be my formula? Below is a two typical
example.

A) ABC corp MLA 12667 MMA50-014-0 BSC-73081
B) Black and Decker SCH 303A4 SCH 3A61-COR BSC-15701

Thanks,
Dinesh

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 103
Default extract cusotmer name from test string

I did come up with "#value" error if no "MLA" or "SCH" present in the text. I
thought "iserror" would take care of it.

"Sean Timmons" wrote:

May want to use something like this:

=IF(ISERROR(FIND(" MLA ",A1)),LEFT(A1,FIND(" SCH ",A1)-1),LEFT(A1,FIND(" MLA
",A1)-1))

I entered space before and after in the find string to avoid capturing
companies that may have MLA or SCH within the name...

"Dinesh" wrote:

I have long string of text that start with customer name. Immediately after
the text string, it populates either the schedule # (which start with "sch")
or master lease agreement # (start with "MLA"). I want to exract only the
customer name from it. What will be my formula? Below is a two typical
example.

A) ABC corp MLA 12667 MMA50-014-0 BSC-73081
B) Black and Decker SCH 303A4 SCH 3A61-COR BSC-15701

Thanks,
Dinesh

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,934
Default extract cusotmer name from test string

Give this formula a try instead...

=LEFT(A1,SEARCH(" SCH "," "&SUBSTITUTE(UPPER(A1),"MLA","SCH")&" SCH ")-1)

--
Rick (MVP - Excel)


"Dinesh" wrote in message
...
I did come up with "#value" error if no "MLA" or "SCH" present in the text.
I
thought "iserror" would take care of it.

"Sean Timmons" wrote:

May want to use something like this:

=IF(ISERROR(FIND(" MLA ",A1)),LEFT(A1,FIND(" SCH ",A1)-1),LEFT(A1,FIND("
MLA
",A1)-1))

I entered space before and after in the find string to avoid capturing
companies that may have MLA or SCH within the name...

"Dinesh" wrote:

I have long string of text that start with customer name. Immediately
after
the text string, it populates either the schedule # (which start with
"sch")
or master lease agreement # (start with "MLA"). I want to exract only
the
customer name from it. What will be my formula? Below is a two typical
example.

A) ABC corp MLA 12667 MMA50-014-0 BSC-73081
B) Black and Decker SCH 303A4 SCH 3A61-COR BSC-15701

Thanks,
Dinesh




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,766
Default extract cusotmer name from test string

Hi,

Use this formula and copy down. B14 holds the text string.

=LEFT(B14,MIN(SEARCH({"MLA","SCH"},B14&"MLASCH"))-1)

--
Regards,

Ashish Mathur
Microsoft Excel MVP
www.ashishmathur.com

"Dinesh" wrote in message
...
I have long string of text that start with customer name. Immediately
after
the text string, it populates either the schedule # (which start with
"sch")
or master lease agreement # (start with "MLA"). I want to exract only the
customer name from it. What will be my formula? Below is a two typical
example.

A) ABC corp MLA 12667 MMA50-014-0 BSC-73081
B) Black and Decker SCH 303A4 SCH 3A61-COR BSC-15701

Thanks,
Dinesh

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
test text string for a comma (,) JR Hester Excel Discussion (Misc queries) 3 June 24th 08 04:14 AM
logical test and concatenate(string) dpayne Excel Discussion (Misc queries) 7 April 5th 07 08:30 PM
Test String LucB Excel Discussion (Misc queries) 2 November 29th 06 02:49 AM
Extract from string mark Excel Discussion (Misc queries) 2 August 8th 06 12:38 PM
Extract sub string sixbeforedawn Excel Worksheet Functions 2 October 24th 05 09:50 AM


All times are GMT +1. The time now is 08:20 PM.

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

About Us

"It's about Microsoft Excel"