LOOKUP (Vector) Function (Functions in Excel)
Name | Jan | Feb | Mar |
Alan | 10 | 80 | 97 |
Bob | 20 | 90 | 69 |
Carol | 30 | 100 | 45 |
David | 40 | 110 | 51 |
Eric | 50 | 120 | 77 |
Francis | 60 | 130 | 28 |
Gail | 70 | 140 | 73 |
Type a Name in this cell : | Eric | |
The Feb value for this person is : | 120 | =LOOKUP(F12,D4:G10,F4:F10) |
What Does It Do ? |
This function looks for a piece of information in a list, and then picks an item from |
a second range of cells. |
Syntax |
=LOOKUP(WhatToLookFor,RangeToLookIn,RangeToPickFrom) |
The WhatToLookFor should be a single item. |
The RangeToLook in can be either horizontal or vertical. |
The RangeToPickFrom must have the same number of cells in it as the RangeToLookin. |
Be careful not to include unnecessary heading in the ranges as these will cause errors. |
Formatting |
No special formatting is needed. |
Example |
The following example shows how the =LOOKUP() function was used to match a name typed |
in cell G41 against the list of names in C38:C43. When a match is found the =LOOKUP() then |
picks from the second range E38:J38. |
If the name Carol is used, the match is made in the third cell of the list of names, and then |
the function picks the third cell from the list of values. |
RangeToLookIn | RangeToPickFrom | ||||||
Alan | 5 | 10 | 15 | 20 | 25 | 30 | |
Bob | |||||||
Carol | |||||||
David | Type a name : | Carol | |||||
Eric | Value : | 15 | |||||
Fred | =LOOKUP(G41,C38:C43,E38:J38) |
Problems |
The list of information to be looked through must be sorted in ascending order, otherwise errors |
will occur, either as #N/A or incorrect results. |
0 comments:
Post a Comment