VBA newbie: How to test the existence of a string in a vector?

  • Thread starter Thread starter Frank Krogh
  • Start date Start date
F

Frank Krogh

I try to test if a string value in a cell is present in a vector/range:

CountyNo
0120
0230
1542
2359
....

The test result could be either boolean or a digit.

Which formula could be applied? Is the LOOKUP formula an alternative?

Thanks for suggestions.


Frank Krogh
 
Frank,

You could use MATCH

=NOT(ISNA(MATCH("0120",A1:A6,0)))

which returns TRUE/FALSE
--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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