#REF! error when using INDEX MATCH

alyos

New Member
Joined
Jan 21, 2022
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I have a question that I hope is straightforward, but I'm struggling to understand it fully.

In column C, I have a list of part numbers. Each distributor (A, B, C, D) provided us with a quote against different manufacturers. Column A identifies the cheapest price within the range (currently hard coded). Now, I need column B to indicate which distributor the cheapest price applies to: A, B, C, or D.

My formula seems to be working only partially (in cell B5), where the correct value was returned, whereas other cells return #REF!. When I change the first MATCH formula in cell B11 from C11,$C$2:$C$11,0, to C11,$C$7:$C$11,0, it comes up with the correct answer, since I've included data where a duplicate material starts from.

Here is a sample file: Example.xlsx.

Ideally, I want it to look like the screenshot attached (output manually entered).

I hope this explanation makes sense.

Thanks a lot in advance!
 

Attachments

  • Screenshot 2024-03-20 132659.png
    Screenshot 2024-03-20 132659.png
    27.8 KB · Views: 13

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
How about
Excel Formula:
=INDEX($E$1:$H$1,,MATCH(A2,E2:H2,0))
 
Upvote 0
Solution
How about
Excel Formula:
=INDEX($E$1:$H$1,,MATCH(A2,E2:H2,0))
Thank you - the problem with this approach is that my actual spreadsheet has 5k rows and different materials & prices, so it's quite likely that there will be duplication of prices across different materials. That's the reason why I wanted two criteria to be used, material & cheapest price.

**Edited** Just tried on my actual spreadsheet, and seems to have worked without referencing material part number! I'll sense check the rest of it and let you know :)
 
Last edited:
Upvote 0
B3 returns #REF because the 1st match returns 2 but you are only indexing a single, so there is no row 2.
 
Upvote 0
I'm with you, thank you for explaining.

I really appreciate your help, it turns out the formula is much less comprehensive than I thought!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,190
Members
452,616
Latest member
intern444

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