Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
 
Posts: n/a
Default Wildcard Not Working in IF statement

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"?

  #2   Report Post  
tjtjjtjt
 
Posts: n/a
Default

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

" wrote:

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"?


  #3   Report Post  
tjtjjtjt
 
Posts: n/a
Default

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
  #4   Report Post  
RagDyeR
 
Posts: n/a
Default

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

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

HTH,

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


wrote in message
oups.com...
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"?


  #5   Report Post  
Gary Rowe
 
Posts: n/a
Default

Try =IF(ISERROR((FIND("McCaleb",A2,1)))=TRUE,"False"," True")

" wrote:

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"?




  #6   Report Post  
Biff
 
Posts: n/a
Default

Hi!

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

Biff

-----Original Message-----
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"?

.

  #7   Report Post  
Harlan Grove
 
Posts: n/a
Default

wrote...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statement with Average Function results in #Value! Paul Excel Discussion (Misc queries) 5 December 28th 04 08:11 AM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM
Statement lintan Excel Worksheet Functions 1 December 2nd 04 11:31 PM
Duplicate fields does not match up! If statement Patsy Excel Worksheet Functions 0 November 11th 04 12:16 AM
IF Statement difficulty susan hayes Excel Worksheet Functions 3 November 2nd 04 09:46 PM


All times are GMT +1. The time now is 09:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"