Vlookup mathing

niko1823

New Member
Joined
Dec 12, 2017
Messages
6
dos
id
dep?
id
begin
end
dept
3/22/2018
1234
1234
4/13/2018
12/31/9999
205
4/6/2018
1234
1234
3/1/2018
4/12/2018
105
4/25/2018
1222
1222
1/31/2018
7/31/2017
106

<tbody>
</tbody>

I have the following. I'm trying to get the dept? a member was in on the dos (date of service). vlookup on its own will not work because it will always return the first match of the id.
in the above example id 1234 dos 3/22/2018 was in dept 105 because 3/22 falls within the begin range 3/1-4/12.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about


Excel 2013/2016
ABCDEFG
1dosiddep?idbeginenddept
222/03/20181234105123413/04/201831/12/9999205
304/06/20181234205123401/03/201812/04/2018105
425/03/20181222106122231/01/201831/07/2018106
Sheet2
Cell Formulas
RangeFormula
C2{=INDEX($G$2:$G$4,MATCH(1,(A2>=E$2:E$4)*(A2<=F$2:F$4)*(B2=D$2:D$4),0))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,596
Messages
6,125,732
Members
449,255
Latest member
whatdoido

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