Home » excel » Cannot get minimum value from a table using a vlookup from a different worksheet in excel

# Cannot get minimum value from a table using a vlookup from a different worksheet in excel

Questions:

I have two worksheets. In Worksheet 1, I have a table like the following

``````ID|PRICE|SELLER

01|12,00|A

01|11,00|B

01|15,00|C

02|12,00|A

02|14,00|B
``````

If I run the following inside the worksheet 1 in a random cell

=INDEX(B2:B4;MATCH(AGGREGATE(15;7;B2:B4/(B2:B4<>0);1);B2:B4;0))

I get PRICE 11,00 so far is correct.

Now I want to get that based on my ID from worksheet 2 and populate it like the following

``````ID|MIN PRICE|SELLER

01|11,00    |B

02|12,00    |A
``````

How can I run a vlookup together with the first formula? from worksheet 2

To get the Minimum price, you can use `MINIFS()`, then a multi-criteria `index/match` for the Seller. (Of course, adjust ranges as necessary)

In `B9`:

``````=MINIFS(\$B\$2:\$B\$6;\$A\$2:\$A\$6;A9)
``````

then enter this one in `C9` as an array formula (use CTRL+SHIFT+ENTER)

``````=INDEX(\$C\$2:\$C\$6;MATCH(A9&B9;\$A\$2:\$A\$6&\$B\$2:\$B\$6;0))
`````` Edit: Without `MINIFS()`, you can use `=MIN(IF(\$A\$2:\$A\$6=A9;\$B\$2:\$B\$6))` as an array formula.