Two Way lookup with exact and approximate match

Intermedius

New Member
Joined
Oct 12, 2012
Messages
32
Hello,

I am trying to figure out a two lookup that will lookup two columns of data, one with an exact match and the other with an approximate match. i.e.

My issue, is that when i deal with thousands of Materials, with different scale sets, I pickup the wrong scales with Scale lookup 1. SO My objective is to pickup the approximate scale according to that specific material.

Scale Lookup 1 =INDEX($I$5:$I$40,MATCH(D6,$I$5:$I$40,1))

Scale Lookup 2 = =INDEX($I$5:$I$40,MATCH(D5,$I$5:$I$40,1),MATCH(B5,$J$5:$J$40,0))

Pstng DateMaterialPurchase OrderPO QuantityScale Lookup 1Scale Lookup 2ScaleMaterial
6/11/2018672740061235423300#REF!10067458258
6/8/201867291470123675005000#REF!15067458258
6/6/2018841707401270500500#N/A20067458258
5/26/201867274072127110001000#REF!25067458258
5/22/201867274072128910001000#REF!30067458258
5/22/201867376093131220001000#N/A50067458258
5/17/2018841709571314600500#REF!100067458258
5/16/2018673638581317800500#N/A150067458258
5/15/201867458258134550050050010067274006
5/9/2018672740721367364300#REF!15067274006
5/9/2018672740721368364300#REF!20067274006
4/27/201867458258141712001000100025067274006
4/27/2018841707401418500500#N/A30067274006
4/27/2018841709571419200200#REF!50067274006
4/21/2018672740721422500500#REF!100067274006
4/12/2018841709571470500500#REF!10067274072
4/12/2018841709571471500500#REF!15067274072
4/10/2018672740061472423300#REF!20067274072
4/4/2018672740721477500500#REF!25067274072
4/4/20186729147014891072010000#REF!30067274072
4/4/2018841707151490200200#N/A50067274072
4/4/2018841707151491200200#N/A100067274072
3/28/2018672740061525423300#REF!150067274072
3/23/2018674582581528600500500100067291470
3/22/2018673638581535790500#N/A500067291470
3/19/2018672740721582139100#REF!1000067291470
3/19/2018672740721583395300#REF!1500067291470
3/19/2018672740721584395300#REF!2000067291470
3/15/2018841709571592400300#REF!3000067291470
3/15/2018841709571593400300#REF!10084170957
15084170957
20084170957
25084170957
30084170957
50084170957
100084170957

<tbody>
</tbody>


My scales can be seen here in matrix form, but I have them in columns side by side for my vertical lookup

SKUScale 1Scale 2Scale 3Scale 4Scale 5Scale 6Scale 7Scale 8Scale 9
6745825810010015020025030050010001500
672740061001001502002503005001000
6727407210010015020025030050010001500
6729147010001000500010000150002000030000
6736385810010015020025030050010001500
6737609310010015020025030050010001500
841703721001001502002503005001000
841707151001001502002503005001000
84170733500500100020003000500070009000
84170740500500100020003000500070009000
841707811001001502002503005001000
841708281001002505001000200060009000
841709571001001502002503005001000
841711431001002505001000200060009000

<tbody>
</tbody>
 

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.
Anyone have an idea about how to approach this? I am not sure how to create my table into spreadsheet on this forum so i have added column names.

Is this possible?

Scale Lookup 1 =INDEX($G$2:$G$40,MATCH(D2,$G$2:$G$40,1))

Scale Lookup 2 = =INDEX($G$2:$G$40,MATCH(D2,$G$2:$G$40,1),MATCH(B2,$H$2:$H$40,0))


Column AColumn BColumn CColumn DColumn EColumn FColumn GColumn H
Pstng DateMaterialPurchase OrderPO QuantityScale Lookup 1Scale Lookup 2ScaleMaterial
6/11/2018672740061235423300#REF!10067458258
6/8/201867291470123675005000#REF!15067458258
6/6/2018841707401270500500#N/A20067458258
5/26/201867274072127110001000#REF!25067458258
5/22/201867274072128910001000#REF!30067458258
5/22/201867376093131220001000#N/A50067458258
5/17/2018841709571314600500#REF!100067458258
5/16/2018673638581317800500#N/A150067458258
5/15/201867458258134550050050010067274006
5/9/2018672740721367364300#REF!15067274006
5/9/2018672740721368364300#REF!20067274006
4/27/201867458258141712001000100025067274006
4/27/2018841707401418500500#N/A30067274006
4/27/2018841709571419200200#REF!50067274006
4/21/2018672740721422500500#REF!100067274006
4/12/2018841709571470500500#REF!10067274072
4/12/2018841709571471500500#REF!15067274072
4/10/2018672740061472423300#REF!20067274072
4/4/2018672740721477500500#REF!25067274072
4/4/20186729147014891072010000#REF!30067274072
4/4/2018841707151490200200#N/A50067274072
4/4/2018841707151491200200#N/A100067274072
3/28/2018672740061525423300#REF!150067274072
3/23/2018674582581528600500500100067291470
3/22/2018673638581535790500#N/A500067291470
3/19/2018672740721582139100#REF!1000067291470
3/19/2018672740721583395300#REF!1500067291470
3/19/2018672740721584395300#REF!2000067291470
3/15/2018841709571592400300#REF!3000067291470
3/15/2018841709571593400300#REF!10084170957
15084170957
20084170957
25084170957
30084170957
50084170957
100084170957

<tbody>
</tbody>
 
Last edited:
Upvote 0
Try to post the expected results instead of the formula results. State clearly in words how the expected results obtain from the matrix you posted.
 
Upvote 0
Not sure i understand what you are looking for,
See if this does what you need

Array formula in F2 copied down
=IFERROR(INDEX(G$2:G$40,MATCH(D2,IF(H$2:H$40=B2,G$2:G$40))),"Not found")
confirmed with Ctrl+Shift+Enter, not just Enter

M.
 
Last edited:
Upvote 0
Try to post the expected results instead of the formula results. State clearly in words how the expected results obtain from the matrix you posted.
Hello Aladin Akyurek,

I think the problem is that i do not know how to present excel data ineligibly for others on Vbulletin.

I have altered my table below.

In normal conditions, columns F & G would be on a different sheet. The result i desire to achieve is to assign the appropriate pricing scale (found in column F) to the quantity in column D. However, the pricing scale must match the Material. So in essence, Column A must match Column G (hand typed), so as to allow column C to approximate the corresponding value of column F.

The desired result would be in be what i have now typed in Column E.

Column D has a standard index match value using "1" as the "match type".

If a PO quantity hits above a scale for that material, it needs to assigned to it the largest scale beneath that figure quantity.

I guess this is what Pearson would call "bracket pricing": http://www.cpearson.com/excel/pricing.htm


Column AColumn BColumn CColumn DColumn EColumn FColumn GDo Columns E & F Match?
MaterialPurchase OrderPO QuantityScale Lookup 1Scale Lookup 2ScaleMaterial
67274006123575075070010067458258FALSE
67458258123622020020015067458258TRUE
67274072127022020017520067458258FALSE
672740061271100075090025067458258FALSE
672740721289100075075030067458258TRUE
6727400613122000750130050067458258FALSE
674582581314600500500100067458258TRUE
672740721317800750750150067458258TRUE
67274006134550050050010067274006TRUE
67274072136736430025030067274006FALSE
67274006136836430030050067274006TRUE
6745825814171200750100070067274006FALSE
67274072141850050050090067274006TRUE
672740061419200200100110067274006FALSE
672740721422500500500130067274006TRUE
67274006147050050050010067274072TRUE
6745825814715005005002567274072TRUE
67274072147242330025017567274072FALSE
67274006147720020010025067274072FALSE
67274072148930#N/A2550067274072#N/A
67274072149016015017575067274072FALSE

<tbody>
</tbody>
 
Last edited:
Upvote 0
Not sure i understand what you are looking for,
See if this does what you need

Array formula in F2 copied down
=IFERROR(INDEX(G$2:G$40,MATCH(D2,IF(H$2:H$40=B2,G$2:G$40))),"Not found")
confirmed with Ctrl+Shift+Enter, not just Enter

M.
Hello Marcelo,

I see that your post shows after mine, but due to my composing while you posted you would not have seen My 3rd post.

I tried your array formula on the table in the 1st post, and i ran into similar issues as my index, match, match formula.

I tried your array formula on my latest table that has less junk in it.

I like your approach. Reading it, i thought the logic would do the trick, but it did not end up matching column E.

=IFERROR(INDEX($F$3:$F$23,MATCH(C3,IF($G$3:$G$23=A2,$F$3:$F$23))),"Not found")

Column AColumn BColumn CColumn DColumn EColumn FColumn GDo Columns D & E Match?
MaterialPurchase OrderPO QuantityScale Lookup 1Hand codedScaleMaterial
672740061235750Not found70010067458258FALSE
67458258123622010020015067458258FALSE
67274072127022020017520067458258FALSE
672740061271100075090025067458258FALSE
672740721289100090075030067458258FALSE
6727400613122000750130050067458258FALSE
674582581314600500500100067458258TRUE
672740721317800500750150067458258FALSE
67274006134550050050010067274006TRUE
67274072136736430025030067274006FALSE
67274006136836425030050067274006FALSE
67458258141712001100100070067274006FALSE
67274072141850050050090067274006TRUE
672740061419200175100110067274006FALSE
672740721422500500500130067274006TRUE
67274006147050050050010067274072TRUE
6745825814715005005002567274072TRUE
67274072147242330025017567274072FALSE
67274006147720017510025067274072FALSE
67274072148930Not found2550067274072FALSE
6727407214901602517575067274072FALSE

<tbody>
</tbody>
 
Last edited:
Upvote 0
In E2 control+shift+enter, not just enter, and copy down:

=VLOOKUP($C2,IF($G$2:$G$22=$A2,$F$2:$F$22),1,1)

It worked on My 2nd table. Appreciate the help. I couldn't get my head around it, but i knew enough that my normal approach of an index,match, match, or a multi column index/match array were not logical for this purpose.

Thank you to Marcelo too. I think maybe i did something wrong because your logic looks identical to Aladin's to My eyes.
 
Upvote 0

Forum statistics

Threads
1,214,591
Messages
6,120,424
Members
448,961
Latest member
nzskater

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