Index, Lookup, Match?

dougwashere

New Member
Joined
Dec 22, 2016
Messages
2
Hey There,

I am hoping someone can help me out here.

I am looking for a formula that will choose the "Closest Match" from the "Available On Hand" list based on the three "Calculated" columns. It does not need to be an exact match, but must fall between the "Calculated MIN and MAX". And have it continue choosing the closest but not using more options than what is on hand.

Basically I want to make sure I am using the best option and all the options, before I have to order additional shims.

Any help would be appreciated.


Book1
ABCDEFGHIJKL
3MINMIDMAXCalculated New Clearance (mm)
4Exhaust Spec (mm)0.250.300.35
5Measured (inch)Measured (mm)Current ShimCalculated MIN ShimCalculated MID ShimCalculated MAX ShimClosest Match On HandShim InstalledAvailable Shims On Hand
6
7
8Cylinder0.0050.1275.4505.3275.2775.2275.4500.1275.530
910.0080.2035.4505.4035.3535.3035.4500.2035.490
105.490
11Cylinder0.0090.2295.4305.4095.3595.3095.4500.2095.470
1220.0090.2295.4205.3995.3495.2995.4200.2295.460
135.450
14Cylinder0.0060.1525.4105.3125.2625.2125.4100.1525.450
1530.0110.2795.3905.4195.3695.3195.3900.2795.450
165.450
17Cylinder0.0110.2795.3905.4195.3695.3195.3900.2795.450
1840.0100.2545.3405.3445.2945.2445.3400.2545.430
195.420
20Cylinder0.0000.0000.000-0.250-0.300-0.3500.0000.0005.410
2150.0000.0000.000-0.250-0.300-0.3500.0000.0005.390
225.390
23Cylinder0.0000.0000.000-0.250-0.300-0.3500.0000.0005.340
2460.0000.0000.000-0.250-0.300-0.3500.0000.000
Sheet2
Cell Formulas
RangeFormula
E8=SUM($C8,-($E$4-$D8))
E9=SUM($C9,-($E$4-$D9))
E11=SUM($C11,-($E$4-$D11))
E12=SUM($C12,-($E$4-$D12))
E14=SUM($C14,-($E$4-$D14))
E15=SUM($C15,-($E$4-$D15))
E17=SUM($C17,-($E$4-$D17))
E18=SUM($C18,-($E$4-$D18))
E20=SUM($C20,-($E$4-$D20))
E21=SUM($C21,-($E$4-$D21))
E23=SUM($C23,-($E$4-$D23))
E24=SUM($C24,-($E$4-$D24))
F8=SUM($C8,-($F$4-$D8))
F9=SUM($C9,-($F$4-$D9))
F11=SUM($C11,-($F$4-$D11))
F12=SUM($C12,-($F$4-$D12))
F14=SUM($C14,-($F$4-$D14))
F15=SUM($C15,-($F$4-$D15))
F17=SUM($C17,-($F$4-$D17))
F18=SUM($C18,-($F$4-$D18))
F20=SUM($C20,-($F$4-$D20))
F21=SUM($C21,-($F$4-$D21))
F23=SUM($C23,-($F$4-$D23))
F24=SUM($C24,-($F$4-$D24))
G8=SUM($C8,-($G$4-$D8))
G9=SUM($C9,-($G$4-$D9))
G11=SUM($C11,-($G$4-$D11))
G12=SUM($C12,-($G$4-$D12))
G14=SUM($C14,-($G$4-$D14))
G15=SUM($C15,-($G$4-$D15))
G17=SUM($C17,-($G$4-$D17))
G18=SUM($C18,-($G$4-$D18))
G20=SUM($C20,-($G$4-$D20))
G21=SUM($C21,-($G$4-$D21))
G23=SUM($C23,-($G$4-$D23))
G24=SUM($C24,-($G$4-$D24))
C8=B8*25.4
C9=B9*25.4
C11=B11*25.4
C12=B12*25.4
C14=B14*25.4
C15=B15*25.4
C17=B17*25.4
C18=B18*25.4
C20=B20*25.4
C21=B21*25.4
C23=B23*25.4
C24=B24*25.4
J8=$C8+($D8-$I8)
J9=$C9+($D9-$I9)
J11=$C11+($D11-$I11)
J12=$C12+($D12-$I12)
J14=$C14+($D14-$I14)
J15=$C15+($D15-$I15)
J17=$C17+($D17-$I17)
J18=$C18+($D18-$I18)
J20=$C20+($D20-$I20)
J21=$C21+($D21-$I21)
J23=$C23+($D23-$I23)
J24=$C24+($D24-$I24)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the message board!

If you want to use approximate matches your lookup column needs to be sorted. All the approximate searches are basically running down the column 'till they bump into first value that's bigger than what they're looking for and then take one step back. That's not exactly how they work but that's the general idea.
 
Upvote 0
Here's my suggestion using two additional columns to sort the current shims on hand column:

Ranking formula to M8:M23:
=RANK(L8,$L$8:$L$23,1)+COUNTIF($L$3:$L8,L8)-1


This one ranks the shims in ascending order. If there are more than one same values in the list the RANK returns the same ranking for each of them. I'm using COUNTIF -1 to solve this problem. Just make sure the COUNTIF is using expanding range.


Sorted Available Shims On Hand column to N8:N23:
=INDEX($L$8:$L$23,MATCH(ROWS($N$8:N8),$M$8:$M$23,0))


This one returns the shims from L-column in ascending order. The MATCH formula is looking for the exact match for the expanding row number from the rank column.


The actual lookup formula looks for approximate match for the E8 value from the sorted shims column:
=INDEX($N$8:$N$23,MATCH(E8,$N$8:$N$23))

Hope is solves your problem and happy holidays!
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

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