#VALUE error-- some cells?

R

roborat

I am doing a VLOOKUP moving out comments from a Pivot Table to separate
column. I have 115 rows, 100 of which work perfectly... but 15 of them give
me the #VALUE error stating "A value used in the formula is of the wrong data
type."

The formula I am using is
=IF(VLOOKUP(LEFT(C19,2500),$C$5:$J$64,1,FALSE)=0,"",(VLOOKUP(LEFT(C19,2500),$C$5:$J$64,1,FALSE)))

Why does it work for some but not others? Some of the ones not working have
acronyms, HR, CC'd, etc... could that be the problem-- and if so, how can I
get it to ignore them?

Thanks!
 
D

Dave Peterson

Did you really want to use the first 2500 characters of C19 in your =vlookup()
expressions???

=vlookup() is one of those functions that breaks if the lookup value is longer
than 255.
 
L

Luke M

I don't think this formula is doing what you think it is...
For instance,
VLOOKUP(LEFT(C19,2500),AnyRange,1,FALSE)
is going to return a value from the first column, aka C, thereby, this
results in C19.

Also, the logic check will never be met, as the VLOOKUP of a value that
exists (as detemrined from first step) will never be 0.

So, in the end, your formula is simply:
=C19
 
L

Luke M

I'm not sure why the word "AnyRange" appears in my post...it should have
been what you originally called out "$C$5:$J$64"...
Apologies.
 

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