Adding a min/max filter to index match

CV12

Board Regular
Joined
Apr 6, 2020
Messages
82
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello everyone,

In the formula in this example sheet, I can look on multiple sheets (indirect) what value in col D belongs to a value in col E. The value from col E is inserted in cell A16.
In this case, we are searching with value 30. Value 30 can belong to cell D3 (Right), or cell D8 (wrong).
I would like to add a filter, so I always get the the right value I want.
Column F always contains numbers that go from small to large. I would like to build in a min/max filter so that the search does not go beyond the minimum and maximum values in column F. These minimum and maximum values are in cells C20 and C21.

So, if a the min is 1, and max is 5, we will NEVER get the wrong value as the corresponding value is 8.

Sandbox.xlsx
ABCDEF
1Sheet2101
2Sheet3202
3Sheet4Right303
4404
5505
6106
7207
8Wrong308
9409
105010
11
12
13
14
15
1630 
17
18
19
201
215
Sandbox
Cell Formulas
RangeFormula
C16C16=IFERROR(INDEX(INDIRECT("'"&INDEX($A$1:$A$3,MATCH(TRUE,COUNTIF(INDIRECT("'"&$A$1:$A$3&"'!E1:E100000"),A16)>0,0))&"'!D1:D100000"),MATCH(A16,INDIRECT("'"&INDEX($A$1:$A$3,MATCH(TRUE,COUNTIF(INDIRECT("'"&$A$1:$A$3&"'!E1:E100000"),A16)>0,0))&"'!E1:E100000"),0)),"")


Hope you understand my question, thanks in advance.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top