CONDITIONAL STATEMENT

R

RYNNER

I HAV A PROBLEM IN CREATING FORMULA, I WISH TO CREATE A FORMULA USING
CONDITIONAL STATEMENTS INVOLVING LETTERS. FOR INSTANCE, IF I ENTER "ABC" THEN
THE FORMULA WORKS. NOW, THIS IS THE PROB, I WISH IT WILL WORK EVEN IF I TYPE
ONLY "AB".. IM TRYIN ASTERISK, BUT IT DOESNT WORK, LIKE "AB*" ... COULD
SOMEONE HELP ME PLEASE..
THANKS IN ADVANCE..
 
C

CurlyDave

I HAV A PROBLEM IN CREATING FORMULA, I WISH TO CREATE A FORMULA USING
CONDITIONAL STATEMENTS INVOLVING LETTERS. FOR INSTANCE, IF I ENTER "ABC" THEN
THE FORMULA WORKS. NOW, THIS IS THE PROB, I WISH IT WILL WORK EVEN IF I TYPE
ONLY "AB".. IM TRYIN ASTERISK, BUT IT DOESNT WORK, LIKE "AB*" ... COULD
SOMEONE HELP ME PLEASE..
THANKS IN ADVANCE..

What kind of Formula are you referring to??
 
B

Barb Reinhardt

You may want to use something like

If myString like "AB*" then

'looks for anything that starts with AB

or
If myString like "*AB*" then
'looks for anything with AB in the middle.
 
S

slarbie

The first response will address your question programmatically. But since
you say you just want a formula, maybe this is what you're looking for.

Assuming your "ABC" or "AB" is entered in cell A1, this formula will say
"Yay" if it matches either one, and "Boo" if it doesn't:
=IF(OR(LEFT(A1,2)="AB",A1="ABC"),"Yay","Boo")

Alternatively, if all you need is a TRUE or FALSE response, the following is
even sympler:
=OR(LEFT(A1,2)="AB",A1="ABC")

Hope that helps...
 
R

RYNNER

sir,
my formula is =IF(A1=PMC 1234,B1+120,"",IF(A1=PLB 1234,B1+60,""))... now,
the problem is.. PMC and PLB is always followed with different numbers..
thats why i am searching for a variable, like asterisk if it can replace it..
making the formula =IF(A1=PMC*,B1+120,"",IF(A1=PLB*,B1+60,""))... but it
doesnt work..

hope u could help me.. thanks..

rynner frm philippines
 

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