IF-INDEX-MATCH: Multiple IF functions with multiple matches returning various results

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
886
Office Version
  1. 365
Platform
  1. Windows
URGENT: I am having a problem with the below formula and seem to be having an off day and can't figure this out. The formula will match the first criteria but not the second and 3rd IF functions. It will just return "False" for the other 2. Any idea what I am missing?

=IF(C14="SPM",(INDEX(Sheet2!C:C,MATCH(D23,Sheet2!A:A,FALSE),IF(C14="Metco",(INDEX(Sheet2!E:E,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Honeywell",(INDEX(Sheet2!G:G,MATCH(D23,Sheet2!A:A,FALSE)))))))))

If I type in SPM in C14 it will return the value in C:C that corresponds with A:A however I get a "FALSE" for the remaining 2.

Thank you for your help

Carla
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
You've got brackets in the wrong places, try
=IF(C14="SPM",INDEX(Sheet2!C:C,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Metco",INDEX(Sheet2!E:E,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Honeywell",(INDEX(Sheet2!G:G,MATCH(D23,Sheet2!A:A,FALSE))))))
 
Upvote 0
Excel changed the formula to: =IF(C14="SPM",INDEX(Sheet2!C:C,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Metco",INDEX(Sheet2!E:E,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Honeywell",(INDEX(Sheet2!G:G,MATCH(D23,Sheet2!A:A,FALSE))))))

However it is still not returning the correct values.
For example for the first set it is returning C3 from Sheet 2 which is correct as A3 on Sheet 2 matches D23 on Sheet1. However for the 2nd IF function it returns E4 when A3 and D23 match and for the 3rd IF function it returns "0" (G5-11 are blank in Sheet 2)
Basically the index is not staying lined up on the same row with the first match C-A, E-A, G-A and so forth.

I am not sure if I am explaining this properly.

Thank you

Carla
 
Upvote 0
That formula works fine for me, so without being able to see your data, I've no idea why its returning the wrong value.
 
Upvote 0
IF C14=SPM,Metco or Honeywell AND IF D23= 444 or any of the below Values in Column A

EXAMPLE

Sheet 1

C14: Metro
D23: 601

FORMULA:[Formula should return Bond: n/a for SPM, 1000psi for Metco and 2350psi for Honeywell] = 1000psi

Sheet 2

Column A Column B Column C Column D Column E Column F Column G

Powder SPM Metco Honeywell
Hardness Bond Hardness BondHardness Bond
444 -2500psi ->4000psi -4250 psi
601 -n/a -1000psi -2350 psi

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>



<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Nevermind. I found my error.

Thank you very much for your help!
 
Upvote 0
That's exactly what I get. Do you have any merged cells?
 
Upvote 0
I do have merged cells but it is working now so all is good. One more question, where would I add an IFERROR return blank in this formula?
basically starting the formula with IFERROR( and ending with ," ").

Thank you

Carla
 
Upvote 0
Like
=IFERROR(IF(C14="SPM",INDEX(Sheet2!C:C,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Metco",INDEX(Sheet2!E:E,MATCH(D23,Sheet2!A:A,FALSE)),IF(C14="Honeywell",INDEX(Sheet2!G:G,MATCH(D23,Sheet2!A:A,FALSE))))),"")
 
Upvote 0

Forum statistics

Threads
1,214,561
Messages
6,120,234
Members
448,951
Latest member
jennlynn

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