Wildcards in an IF Formula


Posted by Paul Magruder on May 24, 2001 9:47 AM

Can you please tell me what to use for Wildcards for Numbers in an If formula?
I tried =IF(AP2="5-###-#",AS2-1,AS2)
But it dosn't reconize the "5".


Thanks in Advance
Paul

Posted by Barrie Davidson on May 24, 2001 9:52 AM

Try
=IF(MID(AP2,1,1)="5",AS2-1,AS2)

I am assuming you are looking for anything that begins with the number 5 and that your data is text (not number).

Barrie

Posted by Aladin Akyurek on May 24, 2001 10:02 AM

Barrie,

Your formula would work with numbers too, if you change it to:

=IF(VALUE(MID(AP2,1,1))=5,"AS2-1","AS2")

Aladin : Can you please tell me what to use for Wildcards for Numbers in an If formula?




Posted by Barrie Davidson on May 24, 2001 10:49 AM

Yeah I know, thanks for the information though (and please don't think that I'm being snotty with this reply, I do appreciate the information).

Barrie Barrie, Your formula would work with numbers too, if you change it to: =IF(VALUE(MID(AP2,1,1))=5,"AS2-1","AS2") Aladin