an approximate match function needed.

kelly mort

Well-known Member
Joined
Apr 10, 2017
Messages
2,169
Office Version
  1. 2016
Platform
  1. Windows
[TABLE="width: 728"]
<tbody>[TR]
[TD][/TD]
[TD="align: right"]50[/TD]
[TD="align: right"]100[/TD]
[TD="align: right"]150[/TD]
[TD="align: right"]200[/TD]
[TD="align: right"]250[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"]350[/TD]
[TD="align: right"]400[/TD]
[TD="align: right"]450[/TD]
[TD="align: right"]500[/TD]
[TD="align: right"]550[/TD]
[TD="align: right"]600[/TD]
[TD="align: right"]650[/TD]
[TD="align: right"]700[/TD]
[TD="align: right"]750[/TD]
[TD="align: right"]800[/TD]
[TD="align: right"]850[/TD]
[TD="align: right"]900[/TD]
[TD="align: right"]950[/TD]
[TD="align: right"]1000[/TD]
[TD="align: right"]1050[/TD]
[TD="align: right"]1100[/TD]
[TD="align: right"]1150[/TD]
[TD="align: right"]1200[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD]A1[/TD]
[TD]B1[/TD]
[TD]C1[/TD]
[TD]D1[/TD]
[TD]E1[/TD]
[TD]F1[/TD]
[TD]G1[/TD]
[TD]H1[/TD]
[TD]I1[/TD]
[TD]J1[/TD]
[TD]K1[/TD]
[TD]L1[/TD]
[TD]M1[/TD]
[TD]N1[/TD]
[TD]O1[/TD]
[TD]P1[/TD]
[TD]Q1[/TD]
[TD]R1[/TD]
[TD]S1[/TD]
[TD]T1[/TD]
[TD]U1[/TD]
[TD]V1[/TD]
[TD]W1[/TD]
[TD]X1[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD]A2[/TD]
[TD]B2[/TD]
[TD]C2[/TD]
[TD]D2[/TD]
[TD]E2[/TD]
[TD]F2[/TD]
[TD]G2[/TD]
[TD]H1[/TD]
[TD]I2[/TD]
[TD]J2[/TD]
[TD]K2[/TD]
[TD]L2[/TD]
[TD]M2[/TD]
[TD]N2[/TD]
[TD]O2[/TD]
[TD]P2[/TD]
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]V18[/TD]
[TD]W18[/TD]
[TD]X18[/TD]
[/TR]
[TR]
[TD="align: right"]95[/TD]
[TD]A19[/TD]
[TD]B19[/TD]
[TD]C19[/TD]
[TD]D19[/TD]
[TD]E19[/TD]
[TD]F19[/TD]
[TD]G19[/TD]
[TD]H1[/TD]
[TD]I19[/TD]
[TD]J19[/TD]
[TD]K19[/TD]
[TD]L19[/TD]
[TD]M19[/TD]
[TD]N19[/TD]
[TD]O19[/TD]
[TD]P19[/TD]
[TD]Q3[/TD]
[TD]R19[/TD]
[TD]S19[/TD]
[TD]T19[/TD]
[TD]U19[/TD]
[TD]V19[/TD]
[TD]W19[/TD]
[TD]X19[/TD]
[/TR]
[TR]
[TD="align: right"]100[/TD]
[TD]A20[/TD]
[TD]B20[/TD]
[TD]C20[/TD]
[TD]D20[/TD]
[TD]E20[/TD]
[TD]F20[/TD]
[TD]G20[/TD]
[TD]H1[/TD]
[TD]I20[/TD]
[TD]J20[/TD]
[TD]K20[/TD]
[TD]L20[/TD]
[TD]M20[/TD]
[TD]N20[/TD]
[TD]O20[/TD]
[TD]P20[/TD]
[TD]Q4[/TD]
[TD]R20[/TD]
[TD]S20[/TD]
[TD]T20[/TD]
[TD]U20[/TD]
[TD]V20[/TD]
[TD]W20[/TD]
[TD]X20 [/TD]
[/TR]
</tbody>[/TABLE]

I have the table above in my worksheet and i need a lookup formula that will use approximate match to get values from the table. The table takes the range; B2:Z22. Then in AC2 I have a value there say 22 and in AC3 another value say 89. Then I want the match pick B5 from the Table and show it in AC4. I hope my point is clear for understanding. Thanks very much in advance.
Kelly
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I think I am getting close but not that clear. So I have used the formula below and it gives me A4 instead of B5.
Code:
AC4=INDEX(C3:Z22,MATCH(AC2,B3:B22,1),MATCH(AC3,C2:Z2,1))

Then I used the below and had #N/A:
Code:
AC4=INDEX(C3:Z22,MATCH(AC2,B3:B22,-1),MATCH(AC3,C2:Z2,-1))

I need the big brains to help pull me out. Thanks again.
Kelly
 
Upvote 0
Kelly, you really don't need that big chart in order to get the value you want.

Even if you deleted the entire chart, the following formula would work in AC4 to give you what you're looking for:

=CHAR(64+CEILING(AC3,50)/50)&CEILING(AC2,5)/5
 
Upvote 0
Generalizing from the single example you provide...

=INDEX($C$2:$Z$21,MATCH(AC2,$B$2:$B$21,1)+(LOOKUP(AC2,$B$2:$B$21) < AC2),MATCH(AC3,$C$1:$Z$1,1)+(LOOKUP(AC3,$C$1:$Z$1) < AC3))

Does this meet your intent?
 
Upvote 0
Kelly, you really don't need that big chart in order to get the value you want.

Even if you deleted the entire chart, the following formula would work in AC4 to give you what you're looking for:

=CHAR(64+CEILING(AC3,50)/50)&CEILING(AC2,5)/5

wow!!! But I am a bit confused here. How does it work??? Because i will late put some REAL data into that chart. I hope you will explain to me how it does that. Thanks
Kelly
 
Upvote 0
Generalizing from the single example you provide...

=INDEX($C$2:$Z$21,MATCH(AC2,$B$2:$B$21,1)+(LOOKUP(AC2,$B$2:$B$21) < AC2),MATCH(AC3,$C$1:$Z$1,1)+(LOOKUP(AC3,$C$1:$Z$1) < AC3))

Does this meet your intent?

Yes, it meets the intention!!!! Thanks alot
Kelly
 
Upvote 0
Hi, Kelly. The first formula would only work with the exact data you gave in the example data set.

If you are going to use other data that isn't letter-number combinations, use this version in AC3:

=INDEX($C$3:$Z$22,CEILING($AC$2,5)/5,CEILING($AC$3,50)/50)

CEILING() just rounds up to the nearest number you use as the second argument. Since your rows are numbered in 5s and your columns are numbered in 50s, we just round your input cell AC2 up to the nearest 5 and divide by 5 to get the INDEX row, and round up AC3 to the nearest 50 then divide by 50 to get the INDEX column.
 
Last edited:
Upvote 0
Hi, Kelly. The first formula would only work with the exact data you gave in the example data set.

If you are going to use other data that isn't letter-number combinations, use this version in AC3:

=INDEX($C$3:$Z$22,CEILING($AC$2,5)/5,CEILING($AC$3,50)/50)


CEILING() just rounds up to the nearest number you use as the second argument. Since your rows are numbered in 5s and your columns are numbered in 50s, we just round your input cell AC2 up to the nearest 5 and divide by 5 to get the INDEX row, and round up AC3 to the nearest 50 then divide by 50 to get the INDEX column.

For the numbers, that is the 5 to 100 in the first column and that of 50 to 1200, they will be static. But the A1, B1, etc; they are just testing data in the table. Will replace them letter. Your first formula was so short and got me more curious.
will try this one and report to you. Thanks
Kelly
 
Upvote 0

Forum statistics

Threads
1,224,895
Messages
6,181,620
Members
453,057
Latest member
LE102024

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