If Statement with Like?

T

Tony

Hello,

Wondering if you can use an if statement with "LIKE"
For example, I have an if statment:
=IF(W2="San Antonio Trade Group",0,AH2*0.85*0.005)

but if someone types in only San Antonio then I will have
a problem. Is there an If then statement with a "LIKE"?
I know access has the like feature.

Thank you
 
R

Ron Rosenfeld

Hello,

Wondering if you can use an if statement with "LIKE"
For example, I have an if statment:
=IF(W2="San Antonio Trade Group",0,AH2*0.85*0.005)

but if someone types in only San Antonio then I will have
a problem. Is there an If then statement with a "LIKE"?
I know access has the like feature.

Thank you

You could use a slightly different construct, plus wildcard characters.

For example:

=IF(COUNTIF(W2,"San Antonio*"),0,AH2*0.85*0.005) will branch to value_if_true
if W2 starts with San Antonio.


--ron
 
T

Tony

Frank,

Thanks a lot. It worked!
Tony
-----Original Message-----
Hi
you could try
=IF(COUNTIF(W2,"*San Antonio*")=0,0,AH2*0.85*0.005)


--
Regards
Frank Kabel
Frankfurt, Germany


.
 

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