Need to use student ID number to pull student name from another workbook.

gilmoregirlz

New Member
Joined
Aug 14, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
I'm trying to add this function into a worksheet that was made by someone else several years ago. I've googled and tried different formulas but I'm not having success. I'm not familar with creating functions at all.

Basically I have a worksheet where I want to be able to type in a student id number and have it pull up the students name. The student numbers and names are stored in a worksheet in a completely different file. I tried to copy one of the existing formulas in the sheet and just changed what seemed to be relevant, but Excel (2010) is saying there is an error with the formula. This is what I'm trying:
=IF(B6="","",IF(ISNA(VLOOKUP(B6,'[Book Inventory saved.xls]Students'!$A:$B,2,0)))

Is there anything in this that immediately jumps out as being wrong? I'm totally lost here and really scrambling to try to get this to work before school starts.
B6 is where I want to type the student number and the student name needs to show up in B7. I'm trying to enter the formula into B7. The student names and numbers are in the "Students" worksheet of the Book Inventory saved.xls file. Numbers are in column A 2<, names are in column B2<.

Any help would be SO very much appreciated!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

gilmoregirlz

New Member
Joined
Aug 14, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Oops, meant to say that B6 is where I want to type the student number and the student name needs to show up in C6. I'm trying to enter the formula into C6.
 

johnnyL

Well-known Member
Joined
Nov 7, 2011
Messages
1,836
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
Do you have both workbooks open?
Is VBA macro code an option to do this?
 

gilmoregirlz

New Member
Joined
Aug 14, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Yes, both workbooks are open when I’m trying to add the formula to cell C6. I’m sorry I’m not sure what VBA macro is. I’m on an older version of excel (2010).
 

johnnyL

Well-known Member
Joined
Nov 7, 2011
Messages
1,836
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
Does the following work for you as a formula:

=IF(B6="","",IFERROR(VLOOKUP(B6, '[Book Inventory saved.xls]Students'!A:B, 2, 0),"Student ID#/Name Not found"))
 

johnnyL

Well-known Member
Joined
Nov 7, 2011
Messages
1,836
Office Version
  1. 2013
  2. 2007
Platform
  1. Windows
The formula with ISNA would look something like:

=IF(B6="","",IF(ISNA(VLOOKUP(B6, '[Book Inventory saved.xls]Students'!A:B, 2, 0)),"Student ID#/Name Not found",VLOOKUP(B6, '[Book Inventory saved.xls]Students'!A:B, 2)))
 

Forum statistics

Threads
1,147,732
Messages
5,742,854
Members
423,759
Latest member
meb229

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top