SEARCH function

  • Thread starter Thread starter lk
  • Start date Start date
L

lk

Hi

Hope this is the right place to post this - this is a formula question as
opposed to VBA but here goes.

I have a column which contains a mixture of numbers, text values and in some
cases a combination between the two for example
0
1
2
3
95*
DNB

I need an if statement to proceed determined by the contents. However if I
do

=SEARCH("*",A1) (or indeed any cell) I'm getting a 1. =SEARCH("d",A1)
gives me correct results either an error or the index of the character. It
seems something peculiar to the "*" character.

I can probably work around it but am I doing something wrong here - it's
Excel 2003 on XP SP3.

Thanks
 
The SEARCH function allows for wildcards and the asterisk is a wildcard
(meaning zero or more unspecified characters). The FIND function does not
allow for wildcards, so I would use that instead. Note, though, that FIND is
a case-sensitive search engine and SEARCH is case insensitive, so you need
to keep that in mind.
 
I just remembered, you can still use SEARCH if you want... the tilde (~)
character can be used to take away the wildcard meaning of a wildcard
character. So...

=SEARCH("~*",A1)
 

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