I have a range with a list of values (depths). I'd like to be able to select the row where the depth matches a value in a cell I provide. If no value matches, the greater value should be selected.

Here's the range.

The solution I found, is to have a temporary area where I revert the order of the range, then I use MATCH to take advantage of the -1 sort parameter.

Last but not least, I use INDIRECT to extract the value of a cell in the same row, but a different column.

=IF(ISNUMBER(A2),INDIRECT("SAC!F"&(MATCH(A2, SAC!$E$1:$E$23, -1))),)

Is there a better way to achieve this result?


  • If the cell has value 6 (exact match), I'd like to get 1.6 (same row)
  • If the cell has value 10 (no match), I'd like to get 2.2 (round to 12, then get the factor)
  • No. It's just an example, the factor must be taken from the row, not calculated with an expression. In fact, the rule you provided would not work for feet. Commented Nov 6, 2014 at 23:14
  • As I said, the value for B cannot be pre-determined from A, take it as a requirement. Commented Nov 6, 2014 at 23:43
  • What does the "SAC!` part mean? Is that a reference to a different sheet?
    – Hugo G
    Commented Jul 9, 2019 at 7:50

3 Answers 3


Two options to try:


=QUERY(SAC!E:F,"select F where E >= "&A2&" order by E limit 1",0)

It's a shame that VLOOKUP doesn't accept the -1 sort parameter, otherwise this would work:


  • 1
    QUERY worked like a charm. Thank you! Commented Nov 15, 2014 at 19:39

I just had a similar problem and solved it nicely with the MINIFS function:

=MINIFS(SAC!E$2:E$23, SAC!A$2:A$23, ">=" & A2)

In short:

select the minimum value from the factor column, where the value in the depth column is equal to or greater than the given value.

  • 1
    This is awesome. I needed MAXIFS in my case, but this was a perfect way to handle the issue, thanks! Commented Dec 8, 2020 at 18:59

Maybe something like:


where F4 contains the 6/10 value.

  • 6 and 10 are just examples, the formula should work for any value in the depth range, not just for 6/10. Commented Nov 6, 2014 at 23:00
  • No, it does not. Apart that the fields where completely wrong, I was able to reuse INDEX to simplify the formula into =IF(ISNUMBER(A4),INDEX(SAC!E:F,(MATCH(A4, SAC!E:E, -1)), 2),), but it still doesn't fix the problem of the order. If I sort with 0 and I don't use the field sorted in reverse range, it does not select the right value. Commented Nov 6, 2014 at 23:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.