# VLOOKUP or INDEX/MATCH Help (Possible VBA)

#### rigeljr

##### New Member
Hi,

I'm looking for a solution to the problem I am having right now. Below are two entries from one tab of my spreadsheet. The unique identifier for this spreadsheet are the SP-SG-###### numbers.

I want to be able to VLOOKUP or Index/Match so that the unique identifiers from the sheet above, get added to the highlighted section on another sheet. As you can see, the 1014 is not unique because the top data has a letter attached, where the bottom does not. Additionally, since the dates are the same, combining doing a DATE&1014 is not a solution either. The Ab/Yar is not a factor in the above data so that can't be used.

Problem: My formula right now would pull SP-SG-13990 from the above table for both Ab and Yar in the below table. Is there a way to find the next unused result instead of just finding the first result?

Thank you!

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

#### Saba Sabaratnam

##### Active Member
You could use the following formula in E8 and copy it down

=INDEX(FILTER(\$E\$2:\$E\$5,(\$A\$2:\$A\$5=A8)*((LEFT(\$D\$2:\$D\$5,4)*1)=D8)),COUNTIFS(\$A\$8:A8,A8,\$D\$8:D8,D8))

Kind regards

Saba

#### rigeljr

##### New Member
That worked for me, thank you!

No problem

Replies
2
Views
133
Replies
4
Views
127
Replies
21
Views
672
Replies
6
Views
335
Replies
6
Views
144

1,141,857
Messages
5,709,027
Members
421,605
Latest member
Danny_G

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