Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you use a wildcard search in a if function (excel)? 1

Status
Not open for further replies.

punchedin

Technical User
Jun 24, 2003
30
US
What I am trying to do is have a formula that will look in A1 and if it see the word "sign" to put yes in B1. Is this possible?

Thanks
 
Yes you can, try looking in excel help for the Left, Search and Find worksheet functions for examples.

Can you provide a better example of what you need to do?
 
I have a description column and I would like to search that column based on a few key words. For example:
A1: Can you read the sign.
B1: This is where is would like the word sign.

A2: Do you see the bus.
B2: Key word = bus.


To look at my results I would use a filter on the key word column.

Does this help.
 
Adnane

=if(find("sign",A1),"eyes","")

That appears to work.

is there a way to not have it return the #VALUE! if the find is empty?
 
Correction

=IF(ISERROR(SEARCH("hat",A1,1)),"no hat","yes hat")
 
Thanks to both of you for all of your help. Much appreciated.

 
Some examples of syntax using wildcards:-

=IF(COUNTIF(A2:A2,"?abc"),"yes","no")

=IF(COUNTIF(A2:A2,"*abc"),"yes","no")

=IF(COUNTIF(A2:A2,"*abc*"),"yes","no")

=IF(ISNUMBER(FIND("abc",A2)),"yes","no")

=IF(ISNUMBER(FIND("abc",A2)),"yes","no")

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Very usefull addition Ken, I'm sure punchedin will benefit although he really didn't necessarily need a wildcard in this case.
 
True, and to be honest I prefer your 'Search' to 'Find' anyway, as Find is Case sensitive, whereas Search isn't, which can throw up unexpected results (or the opposite even, in not throwing up expected results) if not known.

Regards
Ken..............

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]

----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top