# Lookup Commands to find 2nd (or 3rd) instance

#### cob98tp

##### Board Regular
Hi All,

I have a list of data stored horizontally across a sheet, and am using HLOOKUP to find data - which all works ok.

However the problem I have is that there may be more thaan 1 match, but I can only ever return the first entry. Is there anyway of changing this to return the 2nd or 3rd entry as well, in cases where the match criteria occurs more than once?

Many Thanks

### Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

##### MrExcel MVP
Hi All,

I have a list of data stored horizontally across a sheet, and am using HLOOKUP to find data - which all works ok.

However the problem I have is that there may be more thaan 1 match, but I can only ever return the first entry. Is there anyway of changing this to return the 2nd or 3rd entry as well, in cases where the match criteria occurs more than once?

Many Thanks

Care to post your working formula?

#### cob98tp

##### Board Regular
Ok, My formula is a little complicated as I am using an indirect to look at the right row..

=HLOOKUP(E10,INDIRECT("'DiaryData'!\$D\$"&(A3*8)-6&":\$IV\$"&(A3*8)),6,0)

A3 contains a number which corresponds to a date. (A3*8)-6 therefore is the row number for the date I'm looking for. Each entry in the Datalist Has 8 rows of info and looks a bit like this...

Date 1 Name
Info 1
Info 2

Info 8
Date 2 Name
Info 1

and so on, with the data stored in the columns next to these headings. The HLOOKUP looks for the correct Name and returns the value in the 'Info 6' row at the moment.

What I want is to have another formula that will look for the 2nd and 3rd instances (if they exist) of the agent name, and display Info 6 again.

Hopefully that is a bit clearer... Many thanks

Replies
24
Views
383
Replies
1
Views
327
Replies
10
Views
785
Replies
0
Views
298
Replies
6
Views
722

1,181,722
Messages
5,931,673
Members
436,798
Latest member
spprtpplcm

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