CONDITIONAL STATEMENT

  • Thread starter Thread starter RYNNER
  • Start date Start date
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..
 
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??
 
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.
 
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...
 
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
 
Back
Top