View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Vlookup and If functions

Refer help on VLOOKUP..

Try the below formula in Sheet1 with unique id in sheet1 A1...
=VLOOKUP(A1,sheet2!A:B,2,0)

'modified to handle no matches
=IF(ISNA(VLOOKUP(A1,sheet2!A:B,2,0)),"",VLOOKUP(A1 ,sheet2!A:B,2,0))

If this post helps click Yes
---------------
Jacob Skaria


"Robin Reid" wrote:

Worksheet 1 and 2 have student ID numbers in column 1 to identify the
records. I am trying to use the ID number to look up information in worksheet
2 and have it placed in a specific cell in worksheet 1. If the ID number is
not contained in worksheet 2 I would like the function to remain blank or to
place the number zero in the cell. If the ID number is located in worksheet 2
then I want the function to return the value in the corresponding column 2.