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

#### gilmoregirlz

##### New Member
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
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
Do you have both workbooks open?
Is VBA macro code an option to do this?

#### gilmoregirlz

##### New Member
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
Does the following work for you as a formula:

#### johnnyL

##### Well-known Member
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)))

Replies
3
Views
344
Replies
0
Views
142
Replies
1
Views
157
Replies
3
Views
190
Replies
26
Views
2K

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.

### Which adblocker are you using?

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

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