Vlookup and If functions

  • Thread starter Thread starter Robin Reid
  • Start date Start date
R

Robin Reid

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.
 
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
 
Back
Top