H
Harvey Waxman
Can a zero be a value in the first column of a lookup?
When I try to use a zero I get a #NA error.
When I try to use a zero I get a #NA error.
Harvey Waxman said:Can a zero be a value in the first column of a lookup?
When I try to use a zero I get a #NA error.
JE McGimpsey said:The short answer is "yes".
The long answer would take knowing what your formula is, including which
of the three lookup functions you're talking about.
Harvey Waxman said:This is the formula:
=LOOKUP(A1,lookups!$A$19:$A$54,"CL"&lookups!$B$19:$B$54)
The range a19:a54 on the sheet named lookups contains sorted but non
consecutive numeric values from 0 to 92 and the range b19:b54 contains either
the number 1 or 2.
If a1 is a 0 it displays #NA. I worked around it with an IF statement but
I'd
still like to understand what I am doing wrong.
The vectors in the 'lookups' sheetJE McGimpsey said:Your formula returns a value for me as long as the first number in
lookup!A19:A54 is less than or equal to zero. Otherwise it *should*
return #N/A. see Help:
Harvey Waxman said:The vectors in the 'lookups' sheet
A B
18 0 1
19 1 1
20 2 2
21 3 2
22 4 2
23 5 2
24 6 2
25 7 2
26 8 1
27 9 2
28 10 2
etc.
The results:
A B
1 1 CL1 formula
=LOOKUP(A1,lookups!$A$18:$A$54,"CL"&lookups!$B$18:$B$54)
2 1 CL1
3 0 #N/A
4 0 #N/A
5 1 CL1
6 1 CL1
7 0 #N/A
8 1 CL1
9 1 CL1
10 1 CL1
11 0 CL1
12 0 CL1
13 0 CL1
JE McGimpsey said:Check your range references. There's no way that both line 3 and line 11
should produce different results, assuming you copied the formula in B1
down. Note that your original post had the lookup vectors $A$19:$A$54,
in which case #N/A would be the *expected* result, since the first value
in the vector would be >0.
Also - are the values in column A of your results sheet calculated? If
so, is it possible that, while displaying 0, the calculation is
returning a small negative value?
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.