wildcard characters and if statements

  • Thread starter Thread starter margie
  • Start date Start date
M

margie

I have a spreadsheet where a user is going to input in cell A1 the nam
of a material. In another cell I want and if statement that looks a
the value in A1 and determines if the string "aluminum" is anywhere i
the text that was unputted in A1. If there is then the out put shoul
say yes, if aluminum is not present then the output should say no. S
I tried this:

=If(A1=*"aluminum"*, "yes", "no")

for instance if the text in A1 is "zinc aluminum alloy" then the outpu
would be yes becasue the word aluminum is in it.

I thought the * would be the wildcard characters but excel keeps givin
me an error.

Any help would be great.
Thanks
 
=IF(NOT(ISERROR(SEARCH(A1,"aluminum"))),"Yes","No")
You're getting an error because the asterisks are outside the quotes.
However, that won't work because Excel would still try to find asterisks.

Bob Umlas
Excel MVP
 
Back
Top