Hi guys,
Currently I face the following problem.
I want to match a value in a range created by a start value in the first column and an end value in the last column.
The simplified version looks like this:
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl66, width: 64"]2[/TD]
[TD="class: xl66, width: 64"]5[/TD]
[TD="class: xl66, width: 64"]foo[/TD]
[/TR]
[TR]
[TD="class: xl65"]2[/TD]
[TD="class: xl66, width: 64"]10[/TD]
[TD="class: xl66, width: 64"]12[/TD]
[TD="class: xl66, width: 64"]bar[/TD]
[/TR]
[TR]
[TD="class: xl65"]3[/TD]
[TD="class: xl66, width: 64"]13[/TD]
[TD="class: xl66, width: 64"]90[/TD]
[TD="class: xl66, width: 64"]john[/TD]
[/TR]
[TR]
[TD="class: xl65"]4[/TD]
[TD="class: xl66, width: 64"]100[/TD]
[TD="class: xl66, width: 64"]120[/TD]
[TD="class: xl66, width: 64"]doe[/TD]
[/TR]
[TR]
[TD="class: xl65"]5[/TD]
[TD="class: xl66, width: 64"]130[/TD]
[TD="class: xl66, width: 64"]132[/TD]
[TD="class: xl66, width: 64"]hello[/TD]
[/TR]
[TR]
[TD="class: xl65"]6[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]7[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]8[/TD]
[TD="class: xl67, width: 64"]131[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
</tbody>[/TABLE]
The value to be tested is A8.
If the value of A8 is between any of the ranges the formula should result in the C column.
So in this case 131 is between A5 and B5 and so it should yield "hello".
If A8 is 129 for instance, the returned value must be nothing (like " ").
I figured the formula had to be an array formula.
A simplified formule (in cell a10) I tried / tested looks like this:
={if($A1:$A5<H131;if(index($A1:$B5;match($A1:$A5;$A1:$A5;0);2)>H1;"right";"wrong");"nope")}
this does not work and results in "nope" and an error.
In fact the final formula will work with dates having the first column start dates and the second column end dates.
Thank you in advance.
Currently I face the following problem.
I want to match a value in a range created by a start value in the first column and an end value in the last column.
The simplified version looks like this:
[TABLE="width: 256"]
<colgroup><col width="64" span="4" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"]A[/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[/TR]
[TR]
[TD="class: xl65"]1[/TD]
[TD="class: xl66, width: 64"]2[/TD]
[TD="class: xl66, width: 64"]5[/TD]
[TD="class: xl66, width: 64"]foo[/TD]
[/TR]
[TR]
[TD="class: xl65"]2[/TD]
[TD="class: xl66, width: 64"]10[/TD]
[TD="class: xl66, width: 64"]12[/TD]
[TD="class: xl66, width: 64"]bar[/TD]
[/TR]
[TR]
[TD="class: xl65"]3[/TD]
[TD="class: xl66, width: 64"]13[/TD]
[TD="class: xl66, width: 64"]90[/TD]
[TD="class: xl66, width: 64"]john[/TD]
[/TR]
[TR]
[TD="class: xl65"]4[/TD]
[TD="class: xl66, width: 64"]100[/TD]
[TD="class: xl66, width: 64"]120[/TD]
[TD="class: xl66, width: 64"]doe[/TD]
[/TR]
[TR]
[TD="class: xl65"]5[/TD]
[TD="class: xl66, width: 64"]130[/TD]
[TD="class: xl66, width: 64"]132[/TD]
[TD="class: xl66, width: 64"]hello[/TD]
[/TR]
[TR]
[TD="class: xl65"]6[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]7[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]8[/TD]
[TD="class: xl67, width: 64"]131[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
</tbody>[/TABLE]
The value to be tested is A8.
If the value of A8 is between any of the ranges the formula should result in the C column.
So in this case 131 is between A5 and B5 and so it should yield "hello".
If A8 is 129 for instance, the returned value must be nothing (like " ").
I figured the formula had to be an array formula.
A simplified formule (in cell a10) I tried / tested looks like this:
={if($A1:$A5<H131;if(index($A1:$B5;match($A1:$A5;$A1:$A5;0);2)>H1;"right";"wrong");"nope")}
this does not work and results in "nope" and an error.
In fact the final formula will work with dates having the first column start dates and the second column end dates.
Thank you in advance.
Last edited: