question regarding VLOOKUP

%3CLINGO-SUB%20id%3D%22lingo-sub-3218776%22%20slang%3D%22en-US%22%3Equestion%20regarding%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3218776%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20am%20trying%20to%20lookup%20a%20few%20values%20from%20a%20random%20database%20with%20formula%20%3DVLOOKUP(Sheet8!C2%3AC9855%2CSheet7!A2%3AB6124%2C1%2CFALSE)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20new%20to%20this%20and%20trying%20to%20understand%20where%20I%20made%20a%20mistake%20to%20get%20a%20spill%20error%20with%20result%20%3D%20%23N%2FA%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-3218776%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3218810%22%20slang%3D%22en-US%22%3ERe%3A%20question%20regarding%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3218810%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1319168%22%20target%3D%22_blank%22%3E%40Tarun2005%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUsing%20Sheet8!C2%3AC9855%20se%20first%20argument%20means%20that%20you're%20looking%20up%209854%20values%2C%20so%20the%20result%20requires%209854%20free%20cells.%3C%2FP%3E%0A%3CP%3EAlso%2C%20why%20do%20you%20use%201%20as%20column%20index%20into%20a%20two-column%20range%3F%20Don't%20you%20want%20to%20return%20a%20value%20from%20column%20B%3F%20If%20so%2C%20use%202%20as%20column%20index.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3218815%22%20slang%3D%22en-US%22%3ERe%3A%20question%20regarding%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3218815%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%3CBR%20%2F%3EYes%20I%20am%20having%209854%20free%20cells%20and%3CBR%20%2F%3EIn%20sheet7%3A%3CBR%20%2F%3Ethe%20values%20I%20want%20to%20return%20are%20in%20A%20and%20the%20values%20I%20want%20to%20lookup%20are%20in%20B%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3218833%22%20slang%3D%22en-US%22%3ERe%3A%20question%20regarding%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3218833%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1319168%22%20target%3D%22_blank%22%3E%40Tarun2005%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETry%3C%2FP%3E%0A%3CP%3E%3DIFERROR(VLOOKUP(Sheet8!C2%3AC9855%2CSheet7!A2%3AB6124%2C2%2CFALSE)%2C%22%22)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20that%20does%20not%20work%3A%20could%20you%20attach%20a%20sample%20workbook%20to%20a%20reply%2C%20or%20if%20that%20is%20not%20possible%2C%20make%20it%20available%20through%20OneDrive%2C%20Google%20Drive%2C%20Dropbox%20or%20similar%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3218856%22%20slang%3D%22en-US%22%3ERe%3A%20question%20regarding%20VLOOKUP%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3218856%22%20slang%3D%22en-US%22%3EI%20used%20this%3A%3CBR%20%2F%3E%3DIFERROR(VLOOKUP(Sheet8!C2%3AC9855%2CSheet7!A2%3AB6124%2C2%2CFALSE)%2C%22%22)%3CBR%20%2F%3Ebut%20I%20just%20get%20blank%20cells%3CBR%20%2F%3Eand%20the%20file%20is%20in%20my%20office%20laptop%20so%20I%20probably%20cant%20share%20it%3C%2FLINGO-BODY%3E
New Contributor

Hi, I am trying to lookup a few values from a random database with formula =VLOOKUP(Sheet8!C2:C9855,Sheet7!A2:B6124,1,FALSE)

 

I am new to this and trying to understand where I made a mistake to get a spill error with result = #N/A

6 Replies

@Tarun2005 

Using Sheet8!C2:C9855 as first argument means that you're looking up 9854 values, so the result requires 9854 free cells.

Also, why do you use 1 as column index into a two-column range? Don't you want to return a value from column B? If so, use 2 as column index.

@Hans Vogelaar
Yes I am having 9854 free cells and
In sheet7:
the values I want to return are in A and the values I want to lookup are in B

@Tarun2005 

Try

=IFERROR(VLOOKUP(Sheet8!C2:C9855,Sheet7!A2:B6124,2,FALSE),"")

 

If that does not work: could you attach a sample workbook to a reply, or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

I used this:
=IFERROR(VLOOKUP(Sheet8!C2:C9855,Sheet7!A2:B6124,2,FALSE),"")
but I just get blank cells
and the file is in my office laptop so I probably cant share it

@Tarun2005 

If you get blanks. that means that none of the cells in Sheet8!C2:C9855 have an exact match in any of the cells of Sheet7!A2:A6124

@Tarun2005 

The good news is that, since you are getting a #SPILL! error, you must be using Excel 365 (or 2021), so you need never use the obsolete VLOOKUP again!  The spill error arises because Excel is trying to give you a result for every lookup value in your formula.  The newer function XLOOKUP will do the same but is more explicit concerning what is being searched and what is being returned.  The formula

=XLOOKUP(value,array1,array1,"(missing)")

will return an array that looks very much like the lookup 'value' array, but with the word "missing" in place to values that could not be found.

[Note: 'value' and 'array1' are defined names I have applied to the single column arrays.]