The HLookup (Horizontal Lookup) Function is used to extract information from massive tables where the data is organized by row, and not by column.
Think about it like it's part of the lookup family of google sheets
It is a great function that works almost like a search engine, and I will show you how to use it in just a few easy steps!
Step #1: Set Your Data Table
HLookup is primarily used for data tables that are separated by columns instead of Rows. That being said, you will need to make sure that you are using the HLookup Function for a horizontal data table.
For the more traditional vertical data table, you will want to use the VLookup (Vertical Lookup) Function. To learn more about that, click the link here.
Also, If you have a vertical data table, you will need to transpose your data.
Step #2: Insert Query
First, let's assume that the data table on the top of the image is the database and the data table on the bottom is where you look up the info from said database.
Start out by inputing the topmost row value of a random person in the group, let's say the Employee ID code 1324 (Bob).
Step #3: =HLOOKUP()
This is definitely one of the more confusing functions but it makes more sense once you break it down into its separate parts.
- Type in "=HLOOKUP(".
- Reference the "key" cell that will be searched upon (in this case, cell C7) followed by a comma.
- Reference the data table's range (in this case, C2 to E4) followed by a comma.
- Select what row you want to have displayed (1 is ID Code, 2 is Name, 3 is Age). followed by a comma.
- Type the word "false". This will set up a conditional statement that insures that the only value that will be displayed is the one that truly matches the parameters of the search.
- End the function with a closing parentheses and hit ENTER.
Step #4: Drag and Fill
Now, to fill in the rest of the data, all you have to do is to click and drag the equation cell downward and it will come back to you with Bob's age, 18.
And there you have it; that is how you use HLOOKUP in Google Sheets.