# Lookup Question

#### Craig92604

##### Well-known Member

Product Code Vendor 1 Vendor 2 Vendor 3 Vendor 4
ABCG \$1.00 2.50 1.18 .99

I would like to return the venor name who selling the Product for the cheapest price. I know this is possible but since a changed jobs 6 months ago I don't get much of an opportunity to use Excel...I'm a bit rusty

Thank you!

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Code:
``=INDEX(\$B\$1:\$D\$1,,MATCH(MIN(OFFSET(\$B\$1:\$D\$1,MATCH(\$G\$1,\$A\$2:\$A\$4,0),0)),OFFSET(\$B\$1:\$D\$1,MATCH(\$G\$1,\$A\$2:\$A\$4,0),0),0))``

Assumptions:
-Your data table is in \$A\$1:\$D\$4
-The vendor numbers are in \$B\$1:\$D\$1
-The part numbers are in \$A\$2:\$A\$4
-The part number being looked up is in \$G\$1

Just change the ranges accordingly.

Regards,

assuming names in row 1 and range therefore (including vendor names) is A1:F2 then your formula could be

=index(A1:F1,1,match(min(B2:F2),A2:F2,0))

Replies
7
Views
221
Replies
3
Views
3K
Replies
1
Views
322
Replies
6
Views
1K
Replies
1
Views
901

1,207,111
Messages
6,076,624
Members
446,216
Latest member
BEEALTAIR

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back