Number between numbers

BradM

New Member
Joined
Jan 27, 2005
Messages
45
Hello,

I have two tables: one with a item name and two numbers x,y and the other table has a category name and x_high, x_Low, Y_high & Y_low. What I am trying to do is see what category each number falls into.

What I want to get in the end is which category each name belongs in based on if the numbers are between the high and low numbers in the category table.

I know I will have to use IIF statements and it will have to be in code. I thought about doing it in excel but It could be a coule thousand names so I didn't want to transfer back and forth.

Any help is appreciated.

Brad
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Modify this to suit:

Code:
SELECT Table2.Name, Table3.Category, Table2.X, Table2.Y
FROM Table2, Table3
WHERE (((Table2.X) Between [Table3].[LowX] And [Table3].[HiX]) AND ((Table2.Y) Between [Table3].[LowY] And [Table3].[HiY]));

where Table2= Item Name Table
Table3 = Category Table

HTH,
CT
 
Upvote 0

Forum statistics

Threads
1,203,752
Messages
6,057,150
Members
444,908
Latest member
Jayrey

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