Using a wildcard in an 'If' formula

  • Thread starter Thread starter Simon Topping
  • Start date Start date
S

Simon Topping

Hi,

I have used the '*' wildcard with lookup formulae with no
problems however when I try to use them with and 'If'
formula, it doesn't work?

The equation below returns the correct value:

=IF(A20="No Contract - TPM","True","False")

however the following doesn't work:

=IF(A20="*TPM","True","False")

Is there something I'm doing wrong or is it just not
possible to use with an 'If' formula?


Thanks

Simon
 
Simon Topping said:
Hi,

I have used the '*' wildcard with lookup formulae with no
problems however when I try to use them with and 'If'
formula, it doesn't work?

The equation below returns the correct value:

=IF(A20="No Contract - TPM","True","False")

however the following doesn't work:

=IF(A20="*TPM","True","False")

Is there something I'm doing wrong or is it just not
possible to use with an 'If' formula?


Thanks

Simon

You could use
=IF(RIGHT(A20,3)="TPM","True","False")
 
And use SEARCH instead of FIND if that TPM can be upper/lower case.

And one more alternative:

=if(COUNTIF(A1,"*tpm*"),true,false)
 

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

Back
Top