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!
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.
Also, If you have a vertical data table, you will need to transpose your data.
Step #1: 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 inputting the topmost row value of a random person in the group, let’s say the Employee ID code 1324 (Bob).
Step #2: =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 ensures 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 #3: 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.