Check if value falls within any two values in the same row

iondrt

New Member
Joined
Mar 7, 2017
Messages
3
I'm trying to come up with a formula to check if a value falls within any set of values in a range. This shows what I would like to display but I need a formula for the "Type" column on the right. The trick is I cant just MIN-MAX the 3 rows because I will be adding more rows in the future; so I really need something that can check between table columns (I'm using a table Type B Min and Max).

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Type B Min[/TD]
[TD]Type B Max[/TD]
[TD] [/TD]
[TD]Value[/TD]
[TD]Type[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]1[/TD]
[TD][/TD]
[TD]5
[/TD]
[TD]Type B[/TD]
[/TR]
[TR]
[TD]13[/TD]
[TD]18[/TD]
[TD][/TD]
[TD]10[/TD]
[TD]n/a[/TD]
[/TR]
[TR]
[TD]26[/TD]
[TD]28[/TD]
[TD][/TD]
[TD]14[/TD]
[TD]Type B[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]16[/TD]
[TD]Type B[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]21[/TD]
[TD]n/a[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]24[/TD]
[TD]n/a[/TD]
[/TR]
</tbody>[/TABLE]


Thanks for reading!
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Book1
ABCDE
1Type B MinType B MaxValueType
2275Type B
3131810n/a
4262814Type B
516Type B
621n/a
724n/a
Sheet1
Cell Formulas
RangeFormula
E2=IF($D2<=INDEX($B$2:$B$1000,MATCH($D2,$A$2:$A$1000,1)),"Type B","n/a")


WBD
 
Upvote 0
Below is what I used in my sheet... but first a few clarifiers:
AK19=value
150 Start=Type B Min
150 End=Type B Max


=IF(AK19<=INDEX(Table1[150 Start],MATCH(AK19,Table1[150 End],1)),"Type B","")

The bold/underlined part goes #N/A but every thing else goes fine. Is there something wrong with my formula or should I be looking at my table?
 
Upvote 0
Update:

turns out all I had to do was flip the direction to get it to work

from: =IF($D2<=INDEX($B$2:$B$1000,MATCH($D2,$A$2:$A$1000,1)),"Type B","n/a")

to:
=IF($D2>=INDEX($B$2:$B$1000,MATCH($D2,$A$2:$A$1000,-1)),"Type B","n/a")

thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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