Count - Why no error message

P

Paul Moles

Frank Kabel provided the following, thanks very much works
beautifully

=IF(LEN(VLOOKUP(E4,A1:C5,2,FALSE))>3,"not employed
here","here")

My question is why does this not produce and error as it
appears to be a divide by zero?

Thanks

Paul Moles
 
J

JulieD

Hi Paul

I've actually gone back to your original question and Frank's formula (and
my original one) seems to do the opposite of what you originally asked:
If the returned text string is longer than 3 carachters,
(believe I neeed countif)

Then display "here" if less than 3 carachters "not employed here"

i think the answer should be
=IF(LEN(VLOOKUP(E4,A1:C5,2,FALSE))<=3,"not employed here","here")

but in either case nothing is getting divided by anything ...

my understanding of your situation is that

as you know the VLOOKUP returns the value from the 2nd column of the table
when an exact match is made - if no match is made the #NA is returned.

therefore using the LEN() we can look at the length of the string returned
if it is #NA then the name was not found and therefore we can say that "they
are not employed here", if it is longer than 3 then something was found to
indicate that they are "here".

If this is what you're using it for a better solution might be
=IF(ISNA(VLOOKUP(E4,A1:C5,2,FALSE)),"not employed here","here")

Hope this helps
Cheers
JulieD
 

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

Top