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

cob98tp

Board Regular
Joined
Nov 18, 2004
Messages
146
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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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?
 
Upvote 0
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 :)
 
Upvote 0

Forum statistics

Threads
1,222,170
Messages
6,164,382
Members
451,886
Latest member
elpepe1970

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top