Compare two columns in Excel using VLOOKUP
Here's how to Compare two columns in Excel using VLOOKUP.
Here's a list of Excel examples that demonstrate the usage of the VLOOKUP function:
Example 1: Basic VLOOKUP
Assume you have a table with employee names and their corresponding salaries. You want to find the salary of a specific employee based on their name.
| A | B |
|--------|------------|
| Name | Salary |
| John | 5000 |
| Lisa | 6000 |
| Mark | 4500 |
In cell C2, you can use the following formula to find John's salary:
```
=VLOOKUP("John", A2:B4, 2, FALSE)
```
This formula will return the value 5000.
Example 2: Approximate Match
Suppose you have a table with product prices and corresponding discount rates. You want to determine the discount rate based on a given price.
| A | B |
|--------|------------|
| Price | Discount |
| 100 | 10% |
| 200 | 20% |
| 300 | 30% |
In cell C2, you can use the following formula to find the discount rate for a price of 250:
```
=VLOOKUP(250, A2:B4, 2, TRUE)
```
This formula will return the value 20%.
Example 3: Multiple Criteria
Assume you have a table with product information, including product names, categories, and prices. You want to find the price of a specific product based on its name and category.
| A | B | C |
|----------|------------|--------|
| Name | Category | Price |
| Apple | Fruit | 2.5 |
| Banana | Fruit | 1.5 |
| Carrot | Vegetable | 1.2 |
In cell D2, you can use the following formula to find the price of an apple in the fruit category:
```
=VLOOKUP("Apple", A2:C4, 3, FALSE)
```
This formula will return the value 2.5.
These are just a few examples of how you can use the VLOOKUP function in Excel. The function is quite versatile and can be adapted to different scenarios based on your specific needs.