I am looking for a formula that will match data between two values and also match another criteria in the table.
As an example I have the two tables below and want to display the 'Code 2' answer in 'Match Code 2'. I have input the correct answers I want it to display below. It's looking for Code 2 where the Time is between the start and finish for the relevant Code 1.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code 1[/TD]
[TD]Start[/TD]
[TD]Finish[/TD]
[TD]Code 2[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]X[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code 1[/TD]
[TD]Time[/TD]
[TD]Match Code 2[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]0.5[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1.7[/TD]
[TD]X[/TD]
[/TR]
</tbody>[/TABLE]
Currently I only have a formula that looks between the values but want to update it so it only looks between the two values of the relevant Code 1 value.
The formula I am using to look between the Start and Finish values to match Code 2 is:
=LOOKUP(2,1/($B$2:$B$6<=B9)/($C$2:$C$6>=B9),$D$2:$D$6)
I also want the result to be dependant on Code 1 as it currently ignores it. Any ideas?
Thanks
As an example I have the two tables below and want to display the 'Code 2' answer in 'Match Code 2'. I have input the correct answers I want it to display below. It's looking for Code 2 where the Time is between the start and finish for the relevant Code 1.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code 1[/TD]
[TD]Start[/TD]
[TD]Finish[/TD]
[TD]Code 2[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]2[/TD]
[TD]4[/TD]
[TD]X[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="width: 500"]
<tbody>[TR]
[TD]Code 1[/TD]
[TD]Time[/TD]
[TD]Match Code 2[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]0.5[/TD]
[TD]X[/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]1.7[/TD]
[TD]X[/TD]
[/TR]
</tbody>[/TABLE]
Currently I only have a formula that looks between the values but want to update it so it only looks between the two values of the relevant Code 1 value.
The formula I am using to look between the Start and Finish values to match Code 2 is:
=LOOKUP(2,1/($B$2:$B$6<=B9)/($C$2:$C$6>=B9),$D$2:$D$6)
I also want the result to be dependant on Code 1 as it currently ignores it. Any ideas?
Thanks