table
table

Reputation: 3

VLOOKUP alternative using three lookup values

As you know Excel only lets you use one lookup value, but I need to compare three lookup values to find a fourth value.

For example in the screenshot below I want to use the information name, pet and business to find who the teacher is on the second sheet. For the record this is just example data to understand how to perform the task and I need to apply this to over 600 rows!

First sheet: Here is the first sheet

Second sheet: Here is my second sheet

Edit: I keep getting an error when I try to enter this formula: =index(Sheet2!A2:G7,MATCH(Sheet1!A5&Sheet!C5&Sheet1!D5,Sheet2!B2:B7&Sheet2!D2:D7&Sheet2!E2:E7,0))

Upvotes: 0

Views: 481

Answers (2)

BruceWayne
BruceWayne

Reputation: 23283

Instead of Vlookup(), you can use Index/Match, which is a nice alternative that lets you do this.

The formula correctly returns "Miss Smith": enter image description here Note: This is entered as an array formula with CTRL+SHIFT+ENTER

So, the basic layout of the formula is: =Index([range to return],match([single look up value],[range where that value would be],0))

You can combine lookup values by concatenating them, as you can see in the screenshot. So, the single lookup values are A2, C2, and D2. And, you'd expect to find "Sarah" in the range G2:G3, "Dog" in H2:H3, etc.

Please let me know if I can clarify anything.

Edit: To help visualize the two sheets thing. I put the table (which you will lookup from) on a sheet called "Data Sheet". The table we need to complete is on "Main WS".

Here's "Main WS": enter image description here

and the "Data Sheet":

enter image description here

Upvotes: 1

user4039065
user4039065

Reputation:

Given the cyclic calulation and disregard for the Worksheet.UsedRange property that the AGGREGATE function exhibits, you will want to cut down the ranges for the lookups to the minimmum required. Pick a column that will typically determine the extent of the lookup range and use that to define the end point of each lookup column.

Sheet2:

        enter image description here

Sheet1:

        enter image description here

The formula in Sheet1!E2 is,

        enter image description here

Fill down as necessary.

Upvotes: 0

Related Questions