# a complicated vlookup?

##### Board Regular
hi all,

I have 2 sheets in my workbook, with very simple data:

Sheet 1

Count Product
3 A
11 A1
3 A2
1 A3
1 A4
1 A6

Sheet 2

Count Product
2 A
1 AL
1 AM
2 A3
3 A2
11 A5

I would like a formula in sheet 2, column C, which will look for the product code in sheet 1 and return the figure to the left of it, so sheet 2 will then look like:

Sheet 2

Count Product Count 2
2 A 3
1 AL
1 AM
2 A3 1
3 A2
11 A5 3

Thanks

### Excel Facts

Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

#### Jonmo1

##### MrExcel MVP
Try like this...

=INDEX(Sheet1!A:A,MATCH(B1,Sheet1!B:B,0))

#### MisterCrash

##### Active Member

=IF(COUNTIF(Sheet1!\$B\$2:\$B\$7, B2)=0, "", INDEX(Sheet1!\$A\$2:\$A\$7, MATCH(B2, Sheet1!\$B\$2:\$B\$7, 0)))

#### njimack

##### Well-known Member
Your formula in Sheet2 C2 would be:
=IF(COUNTIF(Sheet1!\$B\$2:\$B\$7,B2),INDEX(Sheet1!\$A\$2:\$A\$7,MATCH(B2,Sheet1!\$B\$2:\$B\$7,0)),"")

(copy down as required)

#### arthurbr

##### Well-known Member
Following C Perason's site a formula like
Code:
``=OFFSET(LLTable,MATCH(F67,OFFSET(LLTable,0,1,ROWS(LLTable),1),0)-1,0,1,1)``
would do the job

replace LLTable with sheet2!a2:b7 and f67 is the value to look up

You can find info on http://www.cpearson.com/excel/TablesAndLookups.aspx under "Left Lookup"

##### Board Regular
Thanks to everyone who responded, this is working now

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,573
Messages
5,838,170
Members
430,533
Latest member
paublojobino

### 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