INDEX MATCH with IF...or something else?

DEHA11

New Member
Joined
Jun 25, 2018
Messages
15
I'm attempting to return a value based on an INDEX, MATCH with an IF and just can't seem to get it nested properly so that it works...or maybe I should be using completely different logic.

The scenario:
Depending on how thick the metal is, we use different tools to cut or bend it. We are trying to put together a spreadsheet that will return the correct tool based on a formula because there are hundreds of thicknesses and hundreds of tools and these change regularly.

Our data is in two sheets in one workbook.

SHEET 1
ABC
1THICKNESSTYPETOOL
2.05S??
3.07S??
4.09FL??

<tbody>
</tbody>

SHEET 2
ABC
1VALUE1TYPETOOL
2.03SA
3.06FLB
4.08SC

<tbody>
</tbody>

I want excel to look at all of the data on sheet two (index A1:C4), make sure the types are the same (match 'sheet 1'!b2, 'sheet 2'!b2:b4,0) and then if the thickness is greater than the Value1 amount, return the tool name (match if 'sheet 1'!a2>sheet 2'a2:a4,c2:c4,0).

I can get each of these formulas to work on their own, but no matter how I nest them, I can't get them to work together.

Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try this array formula

<a2)*row(sheet2!$c$2:$c$4)))}


{=INDEX(Sheet2!$C$1:$C$4,MAX((Sheet2!$B$2:$B$4=B2)*(Sheet2!$A$2:$A$4 < A2)*ROW(Sheet2!$C$2:$C$4)))}



Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself</a2)*row(sheet2!$c$2:$c$4)))}>
 
Last edited:
Upvote 0
Thank you for the array formula. I was able to enter it and the brackets are there, but it is not working as expected.

First, the "type" match (Sheet2!$B$2:$B$4=B2) isn't working, see illustration below.

Next, what I really need is the VALUE1 to be the next number that is less than the thickness. I believe that is what the array is asking for with "MAX", but I want to make sure that my assumption is correct. Otherwise the thickness of .0747 could return the result of Tool A or Tool B, but I really need it to be Tool B.


The actual formula I am using in cell C6 is: {=INDEX(Sheet2!$D$3:$D$1000,MAX((Sheet2!$B$3:$B$1000=$D$5)*(Sheet2!$A$3:$A$1000<$C6)*ROW(Sheet2!$D$3:$D$1000)))}

Sheet1

BCD
4MaterialThicknessTool/Type
5S
616 Ga.0598Result is Tool B should be A
714 Ga.0747Result is Tool C should be B

<tbody>
</tbody>









Sheet2

ABCD
Value1TypeLengthTOOL
3.0310SN/ATool A
4.062SN/ATool B
5.125FL145Tool C

<tbody>
</tbody>









Any idea why my results are not correct?

THANK YOU!!
 
Last edited:
Upvote 0
The index should start in row 1

T

The actual formula I am using in cell C6 is: {=INDEX(Sheet2!$D$1:$D$1000,MAX((Sheet2!$B$3:$B$1000=$D$5)*(Sheet2!$A$3:$A$1000 < $C6)*ROW(Sheet2!$D$3:$D$1000)))}
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,239
Members
448,555
Latest member
RobertJones1986

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