Wildcard Not Working in IF statement

  • Thread starter Thread starter jrmccaleb
  • Start date Start date
J

jrmccaleb

I'm having trouble getting the "*" wildcard to work in my IF statement.


Here's a simple example of my formula that resides in {Column B}:

=IF(A2="*McCaleb",TRUE,FALSE)

Here's my array:
{Column A} {Column B}
Justin McCaleb FALSE
Daniel McCaleb FALSE
Tori McCaleb FALSE
Jeff McCaleb FALSE
Renee McCaleb FALSE
Chuck Lodge FALSE
Marlene Lodge FALSE
Mom Durst FALSE
Jim Durst FALSE
Bruce Smith FALSE
Lynda Smith FALSE
Shouldn't this return a "TRUE" in any cell that contains "McCaleb"?
 
An alternative:
=IF(ISERROR((SEARCH("McCaleb",A2,1))),FALSE,TRUE)

Or, if having the TRUE and FALSE is confusing:
=IF(NOT((ISERROR((SEARCH("McCaleb",A2,1))))),TRUE,FALSE)

tj
 
For a "True" or "False", try this:

=ISNUMBER(FIND("McCaleb",A2))
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


I'm having trouble getting the "*" wildcard to work in my IF statement.


Here's a simple example of my formula that resides in {Column B}:

=IF(A2="*McCaleb",TRUE,FALSE)

Here's my array:
{Column A} {Column B}
Justin McCaleb FALSE
Daniel McCaleb FALSE
Tori McCaleb FALSE
Jeff McCaleb FALSE
Renee McCaleb FALSE
Chuck Lodge FALSE
Marlene Lodge FALSE
Mom Durst FALSE
Jim Durst FALSE
Bruce Smith FALSE
Lynda Smith FALSE
Shouldn't this return a "TRUE" in any cell that contains "McCaleb"?
 
I forgot a word in my description of the second formula.
This line:
Or, if having the TRUE and FALSE is confusing Should have read:
Or, if having the TRUE and FALSE reversed is confusing:

tj
 
Hi!

Everyone offered good alternatives but nobody mentioned
that an IF() will not accept wildcards.

Biff
 
I'm having trouble getting the "*" wildcard to work in my IF statement.

Here's a simple example of my formula that resides in {Column B}:

=IF(A2="*McCaleb",TRUE,FALSE)
....

Everyone else seems to like long formulas with many function calls. The
minimalist approach would be

=COUNTIF(A2,"*McCaleb")=1
 

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

Back
Top