Objective: I am trying to obtain a number (ID) from Table A based off of the Date and Number in Table B. What I am trying to say in my formula is that if Phone Number in Table B is equal to a Phone Number in Table A, and the Date in Table B in the same row as that Phone Number is between the Start and End Date in Table A, then I want the corresponding ID from Table A generated in the first column in Table B.
Furthermore, if the phone number matches but it does not fall between a one of the list of dates, I need it to pull the ID from the closest range of dates before it.
For instance, the last row in Table B has a Master Date of 4/22/19, however there is no date range in Table A for it, so it is pulling the ID from the date ranges of 3-26-19 to 4-1-19 because it is the closest date ranges before the master date.
Hopefully this makes sense and there is some wizard out there who can accomplish this. Multiple formulas building on each other is fine as well.
Table A
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Name[/TD]
[TD]ID[/TD]
[TD]Date Start[/TD]
[TD]Date End[/TD]
[TD]Phone Number[/TD]
[/TR]
[TR]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]Apple[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]375[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]12/30/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]1/5/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-908-5231[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]224[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]12/30/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]1/5/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-8442[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[TD]846[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]3/26/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]4/1/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-5592[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Lemon[/TD]
[TD]552[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]5/26/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]6/1/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-5592[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Table B
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Master Date[/TD]
[TD]Phone Number[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]224[/TD]
[TD]1/3/19[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-8442[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]846[/TD]
[TD]3/27/19[/TD]
[TD]210-361-5592[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]846[/TD]
[TD]4/22/19[/TD]
[TD]210-361-5592[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Furthermore, if the phone number matches but it does not fall between a one of the list of dates, I need it to pull the ID from the closest range of dates before it.
For instance, the last row in Table B has a Master Date of 4/22/19, however there is no date range in Table A for it, so it is pulling the ID from the date ranges of 3-26-19 to 4-1-19 because it is the closest date ranges before the master date.
Hopefully this makes sense and there is some wizard out there who can accomplish this. Multiple formulas building on each other is fine as well.
Table A
[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD]Name[/TD]
[TD]ID[/TD]
[TD]Date Start[/TD]
[TD]Date End[/TD]
[TD]Phone Number[/TD]
[/TR]
[TR]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64"]Apple[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]375[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]12/30/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]1/5/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-908-5231[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Pear[/TD]
[TD]224[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]12/30/2018[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]1/5/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-8442[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Grape[/TD]
[TD]846[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]3/26/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]4/1/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-5592[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD]Lemon[/TD]
[TD]552[/TD]
[TD][TABLE="width: 108"]
<tbody>[TR]
[TD="class: xl65, width: 108, align: right"]5/26/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 102"]
<tbody>[TR]
[TD="class: xl65, width: 102, align: right"]6/1/2019[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-5592[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
Table B
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]Master Date[/TD]
[TD]Phone Number[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]224[/TD]
[TD]1/3/19[/TD]
[TD][TABLE="width: 122"]
<tbody>[TR]
[TD="width: 122"]210-361-8442[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]846[/TD]
[TD]3/27/19[/TD]
[TD]210-361-5592[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]846[/TD]
[TD]4/22/19[/TD]
[TD]210-361-5592[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]