IF function and wildcards

G

Guest

Is it possible to use wildcards in an IF function to test a text string in a
cell.

I have a cell that could contain 2 text string options
"300 Denier Polyester" or
"600 Denier Polyester"

Because the operators who input this text may write it in different ways
(300 Denier Polyester or Polyester 300 Denier)
I would like to write an IF function in another cell that tests the cell in
question for whether the string contains 300 or 600 and depending on the
result, perform a different calculation
 
B

Bernard Liengme

Something for you to experiment with:
=IF(ISNUMBER(FIND("300",A1)),"X","Y")
best wishes
 
G

Guest

try:

=IF(ISNUMBER(SEARCH("300",A1)),"300
Found",IF(ISNUMBER(SEARCH("600",A1)),"600 Found","Neither found"))
 
R

Rick Rothstein \(MVP - VB\)

You can use Find for case insensitive searches like this....

=IF(ISNUMBER(FIND(300,A2)),"Yes","No")

If you need case sensitivity, then you would use the SEARCH function
instead.

Rick
 
G

Guest

Thought it was the other way round ? <g>
FIND is case sensitive while SEARCH is not
 
R

Rick Rothstein \(MVP - VB\)

LOL... I think my mind wandered there a little bit, huh? What I was talking
about when I **started** me response was the fact that values such as 300,
where there was no case to worry about, work fine with the FIND function...
and then I have no idea what happened to my response by the time I finished
it. And I can't even use "it was a long response" to explain it either (that
was one of my shorter responses). Thanks for catching that.

Rick
 
R

Rick Rothstein \(MVP - VB\)

As Max has pointed out elsewhere, FIND is a case **sensitive** function
whereas SEARCH is not. What I was trying to say, before I screwed my
response up royally, is that you can use FIND for this case because you are
looking for a value (300) which does not have upper/lower case issues.

Rick
 

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