looking for excel function help

E

ExcelNewb

column A and B
need column B to look in A's Data
and search for -xxxx and -yyyy
if data in A contains any -xxxx or -yyyy letters
then B shows Yes, if not shows No

How can this be done, plz help

:(
 
G

Gord Dibben

Newb

In B1 enter =IF(OR(A1="-xxxx",A1="-yyyy"),"Yes","No")

Drag/copy down column B.

Gord Dibben Excel MVP
 
M

Max

One way, try:

=IF(AND(ISERROR(SEARCH("*"&"-xxxx"&"*",A1)),ISERROR(SEARCH("*"&"-yyyy"&"*",A
1))),"No","Yes")
 
E

ExcelNewb

thx for the fast reply
but its not working.
everything just goes No
I need it to search the data if contains -xxxx or -yyyy in the data
such as,

if A1 = Microsoft-xxxx
then B1 would display yes

if A2 = Microsoft-yyyy
then B2 would display yes

if A3 = Microsoft
then B3 would display N
 
M

Max

Maybe give my suggestion a try, i.e.

Put in B1:
=IF(AND(ISERROR(SEARCH("*"&"-xxxx"&"*",A1)),ISERROR(SEARCH("*"&"-yyyy"&"*",A
1))),"No","Yes")

Copy B1 down col B as many rows as you have data in col A
 
M

Max

Watch out for any inadvertent line wrap/break
when you paste the formula in the formula bar
(you have to clear the wraps/breaks via Delete/Backspace key
after pasting)

The one below should be better (free of line wrap/break)

Put in B1:

=IF(AND(ISERROR(SEARCH("*"&"-xxxx"&"*",A1)),ISERROR(SEARCH("*"&"-yyyy"&"*",A
1))),"No","Yes")
 
E

ExcelNewb

Max said:
*Watch out for any inadvertent line wrap/break
when you paste the formula in the formula bar
(you have to clear the wraps/breaks via Delete/Backspace key
after pasting)

The one below should be better (free of line wrap/break)

Put in B1:

=IF(AND(ISERROR(SEARCH("*"&"-xxxx"&"*",A1)),ISERROR(SEARCH("*"&"-yyyy"&"*",A
1))),"No","Yes")
Thx for the help but its still not working
It just gives me a message saying the formula i typed contains a
error:confused
 
M

Max

Thx for the help but its still not working
It just gives me a message saying the formula i typed contains an
error:confused:

That's because you haven't cleared the line wraps / breaks
after you copy > pasted the formula.

Unfortunately, the line wrap / break was still present in the post

[Apologies for the apparently misleading line:
The one below should be better (free of line wrap/break) ]

Put your cursor just before this the "1"
in this end part of the formula:

" .... 1))),"No","Yes") "

and press Backspace key, then Enter.

It should be ok now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top