Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 137
Default Nested MID and FIND - OR?

Hello all!

Does anyone know how I may be able to search a string and extract text from
it using the MID and FIND function with multiple FINDS? I have a spreadsheet
for which I have a lengthy bit of text for which I have set up to currently
extract ",IE". I need to adapt the formula
=MID(Dump!A1,FIND(",IE.",Dump!A1)-2,5) to also search for either ",MA" or a
",MC". These characters will always be unique and there will not be a
combination of either in the text string. The string will have either one of
the three but not two or all of them. I thought there may be an OR function
I could use but am having no luck.

Thank you for your time any any help you may be able to provide.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Nested MID and FIND - OR?

First of all, I prefer to use SEARCH rather than FIND because FIND is
case-sensitive, although that might be important to you. Here's one
way of doing it:

=IF(ISNUMBER(SEARCH(",IE.",Dump!A1)),MID(Dump!A1,S EARCH(",IE.",Dump!
A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MA",Dump!A1)),MID(Dump!A1,SEA RCH
(",MA",Dump!A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MC",Dump!A1)),MID(Dump!
A1,SEARCH(",MC",Dump!A1)-2,5),"")

All one formula - hopefully you can see how it could be extended to
include other conditions.

Hope this helps.

Pete

On Jan 13, 3:15*pm, Brenda wrote:
Hello all!

Does anyone know how I may be able to search a string and extract text from
it using the MID and FIND function with multiple FINDS? *I have a spreadsheet
for which I have a lengthy bit of text for which I have set up to currently
extract ",IE". *I need to adapt the formula
=MID(Dump!A1,FIND(",IE.",Dump!A1)-2,5) to also search for either ",MA" or a
",MC". *These characters will always be unique and there will not be a
combination of either in the text string. *The string will have either one of
the three but not two or all of them. *I thought there may be an OR function
I could use but am having no luck.

Thank you for your time any any help you may be able to provide.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 137
Default Nested MID and FIND - OR?


Thanks Pete! I appreciate your help. This did the trick and I learned
something!

"Pete_UK" wrote:

First of all, I prefer to use SEARCH rather than FIND because FIND is
case-sensitive, although that might be important to you. Here's one
way of doing it:

=IF(ISNUMBER(SEARCH(",IE.",Dump!A1)),MID(Dump!A1,S EARCH(",IE.",Dump!
A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MA",Dump!A1)),MID(Dump!A1,SEA RCH
(",MA",Dump!A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MC",Dump!A1)),MID(Dump!
A1,SEARCH(",MC",Dump!A1)-2,5),"")

All one formula - hopefully you can see how it could be extended to
include other conditions.

Hope this helps.

Pete

On Jan 13, 3:15 pm, Brenda wrote:
Hello all!

Does anyone know how I may be able to search a string and extract text from
it using the MID and FIND function with multiple FINDS? I have a spreadsheet
for which I have a lengthy bit of text for which I have set up to currently
extract ",IE". I need to adapt the formula
=MID(Dump!A1,FIND(",IE.",Dump!A1)-2,5) to also search for either ",MA" or a
",MC". These characters will always be unique and there will not be a
combination of either in the text string. The string will have either one of
the three but not two or all of them. I thought there may be an OR function
I could use but am having no luck.

Thank you for your time any any help you may be able to provide.


.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Nested MID and FIND - OR?

Glad to hear it, Brenda - thanks for feeding back.

Pete

On Jan 13, 6:15*pm, Brenda wrote:
Thanks Pete! *I appreciate your help. *This did the trick and I learned
something!



"Pete_UK" wrote:
First of all, I prefer to use SEARCH rather than FIND because FIND is
case-sensitive, although that might be important to you. Here's one
way of doing it:


=IF(ISNUMBER(SEARCH(",IE.",Dump!A1)),MID(Dump!A1,S EARCH(",IE.",Dump!
A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MA",Dump!A1)),MID(Dump!A1,SEA RCH
(",MA",Dump!A1)-2,5),"")& IF(ISNUMBER(SEARCH(",MC",Dump!A1)),MID(Dump!
A1,SEARCH(",MC",Dump!A1)-2,5),"")


All one formula - hopefully you can see how it could be extended to
include other conditions.


Hope this helps.


Pete


On Jan 13, 3:15 pm, Brenda wrote:
Hello all!


Does anyone know how I may be able to search a string and extract text from
it using the MID and FIND function with multiple FINDS? *I have a spreadsheet
for which I have a lengthy bit of text for which I have set up to currently
extract ",IE". *I need to adapt the formula
=MID(Dump!A1,FIND(",IE.",Dump!A1)-2,5) to also search for either ",MA" or a
",MC". *These characters will always be unique and there will not be a
combination of either in the text string. *The string will have either one of
the three but not two or all of them. *I thought there may be an OR function
I could use but am having no luck.


Thank you for your time any any help you may be able to provide.


.- Hide quoted text -


- Show quoted text -


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
Use of Find with Left, Mid, Right functions in nested IF(and('s MJW[_2_] Excel Discussion (Misc queries) 8 September 20th 07 09:22 PM
Nested IF, reports incorrectly, can't find anything like it to ref Chris T-M Excel Worksheet Functions 6 September 12th 07 03:20 PM
Calc cost pro rata (nested IF's and macro to find empty row) herbwarri0r Excel Worksheet Functions 2 June 19th 07 12:29 PM
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
Nested If statement to find greater than but less than numbers Aaron Excel Worksheet Functions 3 November 10th 06 03:14 AM


All times are GMT +1. The time now is 08:02 AM.

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"