Forum Discussion

NotSoFastEddie's avatar
NotSoFastEddie
Brass Contributor
Feb 29, 2024

Determine where a value fits between a table of ranges and pull an associated cell from the row

An Excel table of number ranges (e.g. 0 - 1, 1.1-2, 2.1-3) and an associated field to retrieve when the value being compared against fits in the range.  Value passed in is 0.18.  This should result in the value fitting in to row 2 (0.17-0.52) and the SKU to be returned is 2234567.  I have an i=IF(AND(A15>=MIN(B8,C8),A15<=MAX(B8,C8)),"YES","NO") working on a single row, but struggling with how to get it to look through all the ranges.

Lower RangeUpper RangeSKU
0.000.161234567
0.170.522234567
0.531.243234567
1.252.434234567
2.444.985234567
4.998.276234567
8.2810.047234567
  • NotSoFastEddie 

    =INDEX($C$2:$C$8,MATCH(1,($A$2:$A$8<=E1)*($B$2:$B$8>=E1),0))

     

    With this formula you can enter the search value in cell E1 and the formula dynamically returns the SKU.

Resources