[TABLE="width: 500"]
<tbody>[TR]
[TD]dos
[/TD]
[TD]id
[/TD]
[TD]dep?
[/TD]
[TD]id
[/TD]
[TD]begin
[/TD]
[TD]end
[/TD]
[TD]dept
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/22/2018
[/TD]
[TD]1234
[/TD]
[TD][/TD]
[TD]1234
[/TD]
[TD]4/13/2018
[/TD]
[TD]12/31/9999
[/TD]
[TD]205
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4/6/2018
[/TD]
[TD]1234
[/TD]
[TD][/TD]
[TD]1234
[/TD]
[TD]3/1/2018
[/TD]
[TD]4/12/2018
[/TD]
[TD]105
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4/25/2018
[/TD]
[TD]1222
[/TD]
[TD][/TD]
[TD]1222
[/TD]
[TD]1/31/2018
[/TD]
[TD]7/31/2017
[/TD]
[TD]106
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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.
<tbody>[TR]
[TD]dos
[/TD]
[TD]id
[/TD]
[TD]dep?
[/TD]
[TD]id
[/TD]
[TD]begin
[/TD]
[TD]end
[/TD]
[TD]dept
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3/22/2018
[/TD]
[TD]1234
[/TD]
[TD][/TD]
[TD]1234
[/TD]
[TD]4/13/2018
[/TD]
[TD]12/31/9999
[/TD]
[TD]205
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4/6/2018
[/TD]
[TD]1234
[/TD]
[TD][/TD]
[TD]1234
[/TD]
[TD]3/1/2018
[/TD]
[TD]4/12/2018
[/TD]
[TD]105
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4/25/2018
[/TD]
[TD]1222
[/TD]
[TD][/TD]
[TD]1222
[/TD]
[TD]1/31/2018
[/TD]
[TD]7/31/2017
[/TD]
[TD]106
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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.