Returns a value from a table corresponding to a match found in the first row.
HLOOKUP([Value], [TableName], [RowIndex], [MatchType])
Where:
Value is the value to be found.
TableName is the table within which the Lookup value is to be found.
RowIndex is the number of the row containing the data to be returned.
MatchType defines whether the match has to be exact (False) or the nearest found (True).
Rule | Meaning |
---|---|
HLOOKUP(CarMakeComboBoxReturn, Vehicles, 2, FALSE) | The function looks in the Vehicles table for a match, in the first row of the table, to the value returned from the CarMakeComboBox.
If a match is found, the function then looks down to the second column and returns the value in the same row as the match found. The rule also specifies that the match needs to be exact (denoted by the FALSE term). In this case, the Car Make selected in the combo box is "Volkswagen", so the function returns "Golf". |
Value | TableName | RowIndex | MatchType | Outcome |
---|---|---|---|---|
"Volkswagen" | Vehicles | 2 | False (Exact) | "Golf" |
"Mazda" | Vehicles | 3 | False (Exact) | "Blackv |
43 | People | 2 | True (Nearest) | "Dave Sharp" |
251 | People | 3 | False (Exact) | 56 |
Vehicles Table
Make | Volkswagen | Ford | Renault | Mazda |
---|---|---|---|---|
Model | Golf | Escort | Kangoo | 2 |
Colour | Blue | Red | White | Black |
People Table
Member ID | 42 | 44 | 96 | 107 | 251 |
---|---|---|---|---|---|
Name | Dave Sharp | Joe Bloggs | Sandra Shield | Thomas Knight | Isabelle Jones |
Age | 25 | 37 | 42 | 21 | 56 |
Gender | Male | Male | Female | Male | Female |