Find a value in a table

Colmans

Board Regular
Joined
May 28, 2016
Messages
62
Hi

I'm trying to work out some code so I can select a value in a table based on two factors. The X & Y axis are numeric and range "up to" and I can reference both in cell in a form, and then calculate the appropriate factor.

1000​
5000​
10000​
10​
0.0%​
0.5%​
0.8%​
20​
0.5%​
0.8%​
1.0%​
30​
0.8%​
1.0%​
1.5%​

Thanks in advance for any suggestions.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
will the values be exact match to the x & y
or nearest and if nearest do you take the higher or lower value

grid lookup

=INDEX(B2:D4,MATCH(H2,A2:A4,0),MATCH(H3,B1:D1,0))

Book14
ABCDEFGHIJ
1100050001000
2100.0%0.5%0.8%Y200.8%
3200.5%0.8%1.0%X5000
4300.8%1.0%1.5%
Sheet1
Cell Formulas
RangeFormula
J2J2=INDEX(B2:D4,MATCH(H2,A2:A4,0),MATCH(H3,B1:D1,0))


this explains a grid look where there is an exact match

mayneed to change the 0 to a 1 or -1 in the match parts
Or use a sumproduct
depends on answers as to nearest ,
 
Last edited:
Upvote 0
will the values be exact match to the x & y
or nearest and if nearest do you take the higher or lower value

grid lookup

=INDEX(B2:D4,MATCH(H2,A2:A4,0),MATCH(H3,B1:D1,0))

Book14
ABCDEFGHIJ
1100050001000
2100.0%0.5%0.8%Y200.8%
3200.5%0.8%1.0%X5000
4300.8%1.0%1.5%
Sheet1
Cell Formulas
RangeFormula
J2J2=INDEX(B2:D4,MATCH(H2,A2:A4,0),MATCH(H3,B1:D1,0))


this explains a grid look where there is an exact match

mayneed to change the 0 to a 1 or -1 in the match parts
Or use a sumproduct
depends on answers as to nearest ,
Thank you :) - will see how I get on.
 
Upvote 0
ok,
as i said - this is for an exact value match
not a close match

so if you had
Y = 22
X = 1129

what result would you expect and why
ALSO

What version of excel are you using - would be worth updating your profile to show version as solutions will be dependant on what version you have and therefore what functions available.
Excel Versions are: 2003/2007/2010/2013/2016/2019/2021/2024 (due April24) /365 subscription , also rather than show more than 1 version . if you have them , show which version you will be using the solution for.
An awful lot of new functions have now been added to the newer versions
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,894
Members
452,948
Latest member
Dupuhini

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