Would be grateful for help adding a conditional filter to an array formula to find the maximum value up to a variable threshold in an unsorted list. I can do it for a whole list using help in other posts, but not for a conditional subset.
Example shown below. For each department, I want to find the name of the individual whose value is closest to or equal to, but not over, to a specific value for their department.
So, for department A with a threshold of 6.2, from the list of 5.6, 3.5 and 6.4, it returns row 2's name, Mike. I need the formula to give the results in cells G2 and G3.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Dept[/TD]
[TD]Name[/TD]
[TD]Value[/TD]
[TD][/TD]
[TD]Dept[/TD]
[TD]Threshold[/TD]
[TD]Person[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A[/TD]
[TD]Mike[/TD]
[TD]5.6[/TD]
[TD][/TD]
[TD]A[/TD]
[TD]6.2[/TD]
[TD]Formula = Mike[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]B[/TD]
[TD]Sarah[/TD]
[TD]8.5[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]2.2[/TD]
[TD]Formula = Sandra[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]A[/TD]
[TD]Lindsey[/TD]
[TD]3.5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]B[/TD]
[TD]Catherine[/TD]
[TD]4.7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]B[/TD]
[TD]Sandra[/TD]
[TD]2.2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]A[/TD]
[TD]Paul[/TD]
[TD]6.4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]B[/TD]
[TD]Geoff[/TD]
[TD]3.3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I know this is likely to need an array formula using MATCH and INDEX, and probably MIN/MAXs given it is unsorted, but I haven't managed to add a conditional filter to the examples I have found that will work on a whole unsorted list.
For duplicates, I'm happy to just return the first result.
Thanks in advance for your help
Chris
[/HTML][/HTML]
Example shown below. For each department, I want to find the name of the individual whose value is closest to or equal to, but not over, to a specific value for their department.
So, for department A with a threshold of 6.2, from the list of 5.6, 3.5 and 6.4, it returns row 2's name, Mike. I need the formula to give the results in cells G2 and G3.
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Dept[/TD]
[TD]Name[/TD]
[TD]Value[/TD]
[TD][/TD]
[TD]Dept[/TD]
[TD]Threshold[/TD]
[TD]Person[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]A[/TD]
[TD]Mike[/TD]
[TD]5.6[/TD]
[TD][/TD]
[TD]A[/TD]
[TD]6.2[/TD]
[TD]Formula = Mike[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]B[/TD]
[TD]Sarah[/TD]
[TD]8.5[/TD]
[TD][/TD]
[TD]B[/TD]
[TD]2.2[/TD]
[TD]Formula = Sandra[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]A[/TD]
[TD]Lindsey[/TD]
[TD]3.5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]B[/TD]
[TD]Catherine[/TD]
[TD]4.7[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]B[/TD]
[TD]Sandra[/TD]
[TD]2.2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]A[/TD]
[TD]Paul[/TD]
[TD]6.4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]B[/TD]
[TD]Geoff[/TD]
[TD]3.3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I know this is likely to need an array formula using MATCH and INDEX, and probably MIN/MAXs given it is unsorted, but I haven't managed to add a conditional filter to the examples I have found that will work on a whole unsorted list.
For duplicates, I'm happy to just return the first result.
Thanks in advance for your help
Chris
[/HTML][/HTML]