Re: Wildcard character in an "If" statement?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Here's one way:

=IF(COUNTIF(A1,"*stringname*"),B1*0.5,B1*0.75)

Or

C1 = stringname

=IF(COUNTIF(A1,"*"&C1&"*"),B1*0.5,B1*0.75)

Biff

SteveDB1" <SteveDB1@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:44655D9E-0204-429F-8C5B-78EB45F2EB65@xxxxxxxxxxxxxxxx
I want to do what seems to be a similar IF function.
Here is my version.
=IF(a1="*stringname*",b1*1/2,b1*3/4)
My goal is to look in a cell which contains a phrase. The phrase itself
varies {the cell contents could be a name of a person, with (word)
following
it}, but the particular component that I'm seeking either shows up as
(word),
or as (word1). Eg., cell contents being within the dbl quote marks: "Dave
Johnson (word)", or "Danny Thomas (word1)"
Where "word" could be anything.
I've tried already, and it <always> returns a false value-- b1*3/4.
1- can I do this?
2- what would I need to do in order to make it work?
I've also tried the tilda, and question mark. Neither of those are
working.
If however, I just have it look in a cell with a single character, the
equation works fine [=if(a1="c",b1*1/2,b1*3/4)]. I'd assume that it'd work
well too if I had just a single word in the cell, as opposed to a number
of
them. For some reason I just can't get it to work with longer elements,
where
I want to locate a single word within a string of 5 or six words.
If I'm unable to do this, what variation would I need to accomplish this?
Thank you.





.



Relevant Pages

  • Re: Duplicate phrases in one cell
    ... Each cell generally has a unique set of phrases ... I would like to eliminate the second instance of the phrase in each ... row cell ... To enter this Macro, opens the Visual Basic Editor. ...
    (microsoft.public.excel.programming)
  • RE: Duplicate phrases in one cell
    ... Dim MyRange, copyrange As Range ... Each cell generally has a unique set of phrases ... I would like to eliminate the second instance of the phrase in each ... row cell ...
    (microsoft.public.excel.programming)
  • Re: Duplicate phrases in one cell
    ... Each cell generally has a unique set of phrases ... I would like to eliminate the second instance of the phrase in each ... row cell ... a Between reviewa Between review ...
    (microsoft.public.excel.programming)
  • Re: Wildcard character in an "If" statement?
    ... My goal is to look in a cell which contains a phrase. ... cell contents being within the dbl quote marks: ... I want to locate a single word within a string of 5 or six words. ...
    (microsoft.public.excel.worksheet.functions)
  • Duplicate phrases in one cell
    ... Each cell generally has a unique set of phrases ... I would like to eliminate the second instance of the phrase in each ... row cell ... a Between reviewa Between review ...
    (microsoft.public.excel.programming)