A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Wildcards in If Statement



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2004, 12:31 AM
Stevkev
external usenet poster
 
Posts: n/a
Default Wildcards in If Statement

It's driving me bonkers. I need to retrieve a true value if the text in a cell contains the word "Rows" plus an * wildcard in an If statement. I am at a loss on what syntax to use to retrieve this value.
  #2  
Old April 30th, 2004, 01:30 AM
Peo Sjoblom
external usenet poster
 
Posts: n/a
Default Wildcards in If Statement

One way

=IF(ISNUMBER(SEARCH("Rows",A1)),"contains","contai ns not")

--

Regards,

Peo Sjoblom

"Stevkev" wrote in message
...
It's driving me bonkers. I need to retrieve a true value if the text in a

cell contains the word "Rows" plus an * wildcard in an If statement. I am
at a loss on what syntax to use to retrieve this value.


  #3  
Old April 30th, 2004, 03:45 AM
Dave Peterson
external usenet poster
 
Posts: n/a
Default Wildcards in If Statement

if that rows is followed directly by an asterisk, then a minor change to Peo's
formula:

=IF(ISNUMBER(SEARCH("Rows~*",A1)),"contains","cont ains not")

or a different formula:
=IF(COUNTIF(A1,"*rows~**")0,"contains","contains not")

the ~* means to look for the asterisk itself--not any set of characters
(represented by the wild card).



Peo Sjoblom wrote:

One way

=IF(ISNUMBER(SEARCH("Rows",A1)),"contains","contai ns not")

--

Regards,

Peo Sjoblom

"Stevkev" wrote in message
...
It's driving me bonkers. I need to retrieve a true value if the text in a

cell contains the word "Rows" plus an * wildcard in an If statement. I am
at a loss on what syntax to use to retrieve this value.


--

Dave Peterson

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:55 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.