Formula Syntax

K

koolkat

I know how to test if a field is EQUAL to something, how do I test to see if
a field contains something?
So if I have 3 tasks with Descriptions "HAT" and "TOP HAT" and "HAT GREEN"
How do make an Iif statement true by searching for anything with HAT in it?
 
R

Rod Gill

Hi,

Experiment with the Instr function. This worked for me:

IIf(InStr(1,[Text2],"Hat"),Yes,No)

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




koolkat said:
I know how to test if a field is EQUAL to something, how do I test to see
if
a field contains something?
So if I have 3 tasks with Descriptions "HAT" and "TOP HAT" and "HAT GREEN"
How do make an Iif statement true by searching for anything with HAT in
it?

__________ Information from ESET Smart Security, version of virus
signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
K

koolkat

SWEEET!! Thanks!

Rod Gill said:
Hi,

Experiment with the Instr function. This worked for me:

IIf(InStr(1,[Text2],"Hat"),Yes,No)

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




koolkat said:
I know how to test if a field is EQUAL to something, how do I test to see
if
a field contains something?
So if I have 3 tasks with Descriptions "HAT" and "TOP HAT" and "HAT GREEN"
How do make an Iif statement true by searching for anything with HAT in
it?

__________ Information from ESET Smart Security, version of virus
signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 5103 (20100510) __________

The message was checked by ESET Smart Security.

http://www.eset.com



.
 

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

Top