Looking up duplicate values

Pauljj

Well-known Member
Joined
Mar 28, 2004
Messages
2,047
Hopefully not too difficult ?!?!

The question here is E7, which is a payroll number, this can appear multiple times, so in the formula below, which will go from G5 across to M5, if it picks up the same payroll number it needs to pick up the second value, instead of the first

To explain Further this is the source data

LeaveTemplate.xls
BCDEFGH
13803XLEDHM03/01/201003/01/2010
24006XDEFL04/11/200913/11/2009
33803XLELMM07/01/201008/01/2010
45034XLEPHM06/11/200915/11/2009
LeaveTemplate


Because the value 3803 (column B) appears twice, my VLOOKUP won't work. How can I pick up both?


IF(AND(R$4>=VLOOKUP($E7,LeaveTemplate'!$B$1:$H$50,6,0),R$4<=VLOOKUP($E7,LeaveTemplate'!$B$1:$H$50,7,0)),VLOOKUP($E7,LeaveTemplate'!$B$1:$H$50,3,0),BL7))
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Is this what you are looking for?

Excel Workbook
ABCDEFG
13803XLEDHM3/1/20103/1/2010
24006XDEFL4/11/200913/11/2009
33803XLELMM7/1/20108/1/2010
45034XLEPHM6/11/200915/11/2009
5
6
738038/1/2010
Sheet1
 
Upvote 0
I think this might be heading in the right direction, however, its probably a good idea to show you where the data will appear





As you can see when on row 5 I get the lookup for staff no 4751. It will pull the first lookup which is between the 03-06 Jan but if from the source data, 4751 appears again for dates between 08-09 Jan, then it doesn't show
 
Upvote 0
I guess I need to understand what it is you are doing with the information from the main spreadsheet with the data in post #3.
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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