Implement HLOOKUP to Find Prices of Products in a Horizontal List
The HLOOKUP function in Excel is a powerful tool that allows you to search for a specific value in the first row of a range or array and return a corresponding value from another row within the same range or array. This function can be particularly useful for finding the prices of products in a horizontal list. In this article, we will guide you through an example of how to use HLOOKUP for this purpose.
Example
Here is an example table that we will use to demonstrate the HLOOKUP function. This table contains a list of products with their corresponding prices.
Product | Apple | Banana | Cherry | Date |
---|---|---|---|---|
Price | $1.00 | $0.50 | $3.00 | $2.50 |
Exercise
Use HLOOKUP to find the price of a product based on its name.
Steps:
- Enter the Product Name in cell A4.
- Use the HLOOKUP function in cell A5 to find the Price.
Solution
Here is how you can set up the HLOOKUP function:
Price Lookup
=HLOOKUP(B3, B1:E2, 2, FALSE)
This formula looks up the Product Name entered in A2 within the range B1:E1 and returns the corresponding Price from the second row within the range B2:E2.
Explanation of the Solution
In the solution, the HLOOKUP function searches for the Product Name in the first row of the given range. If it finds a match, it returns the corresponding value from the second row. The fourth argument (FALSE) ensures that the function looks for an exact match. This setup ensures that users get accurate and relevant prices for the products they are looking up.
Feel free to enter different Product Names in the embedded sheet to see how the HLOOKUP function dynamically retrieves and displays the product prices.