IF(ISERROR...


Posted by Tim on October 22, 2001 6:35 AM

I've been using a statement as follows:

IF(ISERROR(VLOOKUP(x,x,x)),0,VLOOKUP(x,x,x))

In words - I need to be sure the vlookup does not return an error statement if no value is found. This formula works, but my spreadsheet is getting way too large (18 MB+) with this formula repeated thousands of times. Is there any way to shorten the formula and still return a 0 or no value when nothing is found in the vlookup?



Posted by IML on October 22, 2001 6:43 AM

You could avoid the double lookup by doing a countif on the first column of your table, for example
=IF(COUNTIF(G1:G10,"lookmeup"),VLOOKUP("lookmeup",G1:H10,2,0),0)

where you are looking up "lookmeup" in a table residing in G1:H10.

good luck