Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Wild Cards with IF stmt

You're welcome.

To directly answer your question:

did I read somewhere that IF stmts don't support wild cards?


That is correct. In the formulas we suggested it's not the IF function
that's using the wildcard, it's the COUNTIF function.

--
Biff
Microsoft Excel MVP


"KarenF" wrote in message
...
ALL these solutions work beautifully! I never thought of using CountIF in
a
a plain IF stmt (I'm not trying to count anything), but these are exactly
what I need. Thanks to all 3 of you ...

KarenF

"T. Valko" wrote:

If "Food" is *always* at the beginning of the string:

=IF(LEFT(X1,4)="Food","Yes,"No")

If "Food" might be anywhere within the string:

=IF(COUNTIF(X1,"*Food*"),"Yes","No")

--
Biff
Microsoft Excel MVP


"KarenF" wrote in message
...
I have a simple IF stmt that I can't get to recognize wild cards.

=IF(X1="Food*","yes","no")

I want it to return a yes for Food, Food Dept, Food Services - Intl,
etc.
In short, anything that starts with food. Shouldn't it be easy?

I have a macro that imports from another spreadsheet. Once I get a
formula
to work, I record that step then paste it to my macro and adjust the
code
so
it compiles, then add steps to copy the formula to the rest of the
rows.

Which is why I can't simply filter on "contains food."

If I can get this simple function to work then I'm confident I can
apply
it
to my complex formula. But, did I read somewhere that IF stmts don't
support
wild cards?

KarenF






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
wild cards? ferde Excel Discussion (Misc queries) 3 May 26th 07 06:28 AM
wild cards in SUMIF charles Excel Worksheet Functions 2 October 17th 06 10:29 PM
If Statement Using Wild Cards Jasmine Excel Worksheet Functions 5 August 23rd 05 10:38 AM
wild cards in formulas and functions Carla at work Excel Worksheet Functions 9 August 19th 05 07:18 PM
Wild Cards With Arrays Brian Excel Discussion (Misc queries) 4 July 7th 05 10:32 PM


All times are GMT +1. The time now is 07:35 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"