# Lookup - what am I doing wrong?

#### meredithsegal

##### New Member
I have multiple sheets as part of a workbook. Several sheets contain master data about students. There are then sheets about each individual student that need to pull data based on the master sheets.

The student's name always appears in cell B2 of the sheet about that student.

I have a sheet called "attendance" where students names are listed in column A and their attendance is listed in column B.

For the field where I need to include attendance (H3), my formula is:
=LOOKUP(B2,Attendance!A1:A17,Attendance!B1:B17)

When I change the name in B2, the function does not update unless I go back to the H3, hit enter, etc. Even then, it is very erratic. What's going on?

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I have multiple sheets as part of a workbook. Several sheets contain master data about students. There are then sheets about each individual student that need to pull data based on the master sheets.

The student's name always appears in cell B2 of the sheet about that student.

I have a sheet called "attendance" where students names are listed in column A and their attendance is listed in column B.

For the field where I need to include attendance (H3), my formula is:
=LOOKUP(B2,Attendance!A1:A17,Attendance!B1:B17)

When I change the name in B2, the function does not update unless I go back to the H3, hit enter, etc. Even then, it is very erratic. What's going on?
Are you sure you want to use LOOKUP?

See if this makes a difference:

=VLOOKUP(B2,Attendance!A1:B17,2,0)

Makes sure calculation is set to Automatic.

What is the difference between Lookup and Vlookup? And what would I do when I need to pull data from a non-adjacent column? (student's name is in A, given data set is in D). Thanks so much!

What is the difference between Lookup and Vlookup? And what would I do when I need to pull data from a non-adjacent column? (student's name is in A, given data set is in D). Thanks so much!
The biggest difference is that the LOOKUP function requires the range of lookup values be sorted in ascending order for the function to work properly. If the range of lookup values are not sorted in ascending order there's no telling what result you will get.

Typically, LOOKUP is used to lookup numeric values although it can be used to lookup text and for other specialized applications.

With VLOOKUP, you have the option of using sorted data or not.

If your lookup values are in column A and the value to be returned is in column D then you would probably use something like this:

=VLOOKUP(B2,Attendance!A1:D17,4,0)

http://contextures.com/xlFunctions02.html

Replies
5
Views
167
Replies
5
Views
193
Replies
4
Views
167
Replies
1
Views
122
Replies
4
Views
198

### Forum statistics

1,196,447
Messages
6,015,321
Members
441,889
Latest member
balolaptopgiaolong

### 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