Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Need formula to locate and validate specific text from a string

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default Need formula to locate and validate specific text from a string

Hello,

Try;
=IF(OR(ISNUMBER(SEARCH("testing",A1)),ISNUMBER(SEA RCH("cold",A1)),ISNUMBER(SEARCH("working",A1))),"Y es","No")
"vinstream" wrote in message
...
Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Need formula to locate and validate specific text from a string

Thanks a ton...this is working.

How many If statements can I use in one formula?






On Apr 7, 11:12*am, "ozgrid.com" wrote:
Hello,

Try;
=IF(OR(ISNUMBER(SEARCH("testing",A1)),ISNUMBER(SEA RCH("cold",A1)),ISNUMBER(*SEARCH("working",A1)))," Yes","No")"vinstream" wrote in message

...



Hi,


I have the following sample data in column A.


germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".


Is this possible?


Regards,


Vinstream- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Need formula to locate and validate specific text from a string

For cell B2:
=IF(OR(IF(ISERR(FIND("testing",A2)),FALSE,TRUE),IF (ISERR(FIND("cold",A2)),FALSE,TRUE),IF(ISERR(FIND( "working",A2)),FALSE,TRUE)),"Yes","No")

Fill that down to the end of your list. Remember that the formula should be
entered as one continuous line in Excel; the system here tends to break long
formulas into several lines.

"vinstream" wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Need formula to locate and validate specific text from a string

Oops, turns out to work better if you use SEARCH instead:

=IF(OR(IF(ISERR(SEARCH("testing",A3)),FALSE,TRUE), IF(ISERR(SEARCH("cold",A3)),FALSE,TRUE),IF(ISERR(S EARCH("working",A3)),FALSE,TRUE)),"Yes","No")


"vinstream" wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Need formula to locate and validate specific text from a string

Would I be right in saying that you could change IF(condition,FALSE,TRUE) to
NOT(condition) ?

Hence
=IF(OR(NOT(ISERR(SEARCH("testing",A3))),NOT(ISERR( SEARCH("cold",A3))),NOT(ISERR(SEARCH("working",A3) ))),"Yes","No")
and then presumably
=IF(AND(ISERR(SEARCH("testing",A3)),ISERR(SEARCH(" cold",A3)),ISERR(SEARCH("working",A3))),"No","Yes" )
?
--
David Biddulph

"JLatham" wrote in message
...
Oops, turns out to work better if you use SEARCH instead:

=IF(OR(IF(ISERR(SEARCH("testing",A3)),FALSE,TRUE), IF(ISERR(SEARCH("cold",A3)),FALSE,TRUE),IF(ISERR(S EARCH("working",A3)),FALSE,TRUE)),"Yes","No")


"vinstream" wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


.


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Need formula to locate and validate specific text from a strin

Some shorter formula:
=IF(ISERR(SEARCH("testing",A1))*ISERR(SEARCH("cold ",A1))*ISERR(SEARCH("working",A1))=0,"Yes","No ")
Micky


"JLatham" wrote:

Oops, turns out to work better if you use SEARCH instead:

=IF(OR(IF(ISERR(SEARCH("testing",A3)),FALSE,TRUE), IF(ISERR(SEARCH("cold",A3)),FALSE,TRUE),IF(ISERR(S EARCH("working",A3)),FALSE,TRUE)),"Yes","No")


"vinstream" wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 464
Default Need formula to locate and validate specific text from a string

Seven pre Excel 2007, but there are better ways.
http://www.ozgrid.com/Excel/seven-nested.htm
http://www.ozgrid.com/Excel/nested-function-limit.htm




--
Regards
Dave Hawley
www.ozgrid.com


"vinstream" wrote in message
...
Thanks a ton...this is working.

How many If statements can I use in one formula?






On Apr 7, 11:12 am, "ozgrid.com" wrote:
Hello,

Try;
=IF(OR(ISNUMBER(SEARCH("testing",A1)),ISNUMBER(SEA RCH("cold",A1)),ISNUMBER(*SEARCH("working",A1)))," Yes","No")"vinstream"
wrote in message

...



Hi,


I have the following sample data in column A.


germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".


Is this possible?


Regards,


Vinstream- Hide quoted text -


- Show quoted text -


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 561
Default Need formula to locate and validate specific text from a strin

As you can learn from my solution you don't need more than one IF statement.
Basically:
Up to "Excel 2003" (incl.) you can nest 7 IF Statements.
From "Excel 2007" you can nest 64 IF Statements.
Usually, no one nests that many statements - not even 7
In such cases one uses a small table with all the possibilities and returns
the result with VLOOKUP.
Micky


"vinstream" wrote:

Thanks a ton...this is working.

How many If statements can I use in one formula?






On Apr 7, 11:12 am, "ozgrid.com" wrote:
Hello,

Try;
=IF(OR(ISNUMBER(SEARCH("testing",A1)),ISNUMBER(SEA RCH("cold",A1)),ISNUMBER(*SEARCH("working",A1))), "Yes","No")"vinstream" wrote in message

...



Hi,


I have the following sample data in column A.


germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".


Is this possible?


Regards,


Vinstream- Hide quoted text -


- Show quoted text -


.

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Need formula to locate and validate specific text from a string

On Tue, 6 Apr 2010 22:51:40 -0700 (PDT), vinstream wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


Another approach:

=IF(OR(COUNTIF(A1,"*"&{"testing","cold","working"} &"*")),"yes","no")
--ron


  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Need formula to locate and validate specific text from a string

On Tue, 6 Apr 2010 22:51:40 -0700 (PDT), vinstream wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)


In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?



Regards,

Vinstream


By the way, mine and the other approaches will also return "yes" if the word
being tested is a Part of the phrase.

For example, if you were testing for 'man', the various formulas would return
"yes" for

Germany
Germany (man)

If this could be a problem, you could modify the formulas to also look for the
"(", assuming your format is always as above. If there are more variations, a
different approach might work better.

For mine:

=IF(OR(COUNTIF(A1,"*("&{"testing","cold","working" }&")*")),"yes","no")
--ron
  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Need formula to locate and validate specific text from a string

One mo

=IF(SUM(COUNTIF(A1,"*"&{"testing","working","cold" }&"*"))0,"Yes","No")

You could actually leave the "0" out of the expression. But I think it makes
the formula easier to understand.

vinstream wrote:

Hi,

I have the following sample data in column A.

germany (testing)
Germany (cold)
Germany
Austria (Testing)
Austria (cold)
Austria (working)
Austria (other)
China
China (alternate)

In column B, I want it to show that if the cell to the left has any of
the words 'testing' or 'cold' or 'working' it should show "yes" in
Column B else show "no".

Is this possible?

Regards,

Vinstream


--

Dave Peterson
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
Nested formula to search a text string and return specific text Barbie Excel Worksheet Functions 10 February 21st 09 07:40 AM
locate cell with specific text and select that column rockytopfan4ever Excel Discussion (Misc queries) 3 July 30th 08 01:53 PM
Formula to extract a specific word from text string Dinesh Excel Worksheet Functions 4 November 3rd 06 08:35 PM
Locate and count the recurrences of a text string Trish2 Excel Discussion (Misc queries) 1 March 8th 06 03:02 PM
can you find specific text in a string ignoring any other text chriscp Excel Discussion (Misc queries) 1 September 18th 05 09:54 PM


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