INDEX MATCH formula works perfectly in 1 workbook, but returns #REF! error in another

Darkshine31

New Member
Joined
Oct 10, 2024
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Good afternoon folks.

I have uploaded 2 snaps of the related formulas here. I works and 1 does not. I'm at a loss as to why. Any help would be much appreciated.

Thanks :)
 

Attachments

  • Snap1 - working.png
    Snap1 - working.png
    81.4 KB · Views: 11
  • Snap2 - not working.png
    Snap2 - not working.png
    74.5 KB · Views: 10

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
I think you have your ROW and COLUMN references mixed up in the INDEX function.
Try this for that part:
Excel Formula:
INDEX(E504:H504,1,MATCH(MIN(E520:H520),E520:H520,0))
You want to pull from the first row since you only have one row in your INDEX range (hence the 1 in the second argument, and whatever column the match is found in.
 
Upvote 0
Solution
I think you have your ROW and COLUMN references mixed up in the INDEX function.
Try this for that part:
Excel Formula:
INDEX(E504:H504,1,MATCH(MIN(E520:H520),E520:H520,0))
You want to pull from the first row since you only have one row in your INDEX range (hence the 1 in the second argument, and whatever column the match is found in.

Thank you Joe4.

I still don't understand why it works on one workbook and not the other but your solution solved my problem, so thank you very much for your time.
 
Upvote 0
I would have to see your other data and example. Maybe there you were dealing with a single-column, multi-row range, where here you have a single-row, multi-column range.
In your original formula, since you had the calculation in the row argument, you were literally telling it to return the second row of a one row range, which is not possible, and hence the REF error!
 
Upvote 0
I would have to see your other data and example. Maybe there you were dealing with a single-column, multi-row range, where here you have a single-row, multi-column range.
In your original formula, since you had the calculation in the row argument, you were literally telling it to return the second row of a one row range, which is not possible, and hence the REF error!
Snap1 - Working (attachment) is the original working formula
 
Upvote 0
As you probably discovered, you cannot attach files to this site. You can post screen images though, like you did in your first post.
 
Upvote 0
The first one working was pure luck. The match was in the first column, so INDEX(range, column, 1) was equivalent to INDEX(range, 1, 1) which works with a 1 row range. As soon as the match is in a different column, you're passing a number greater than 1 as the row argument.
 
Upvote 0
The first one working was pure luck. The match was in the first column, so INDEX(range, column, 1) was equivalent to INDEX(range, 1, 1) which works with a 1 row range. As soon as the match is in a different column, you're passing a number greater than 1 as the row argument.
I think I may have missed that your first image in your first post is the one that works. I didn't realize that was the one you were talking about, as it did not look like the same formula.
When I originally opened the PDF, the menu options covered up the portion of your formula with the INDEX/MATCH formula.

Thanks for clearing it up, Rory!
 
Upvote 0
The first one working was pure luck. The match was in the first column, so INDEX(range, column, 1) was equivalent to INDEX(range, 1, 1) which works with a 1 row range. As soon as the match is in a different column, you're passing a number greater than 1 as the row argument.
Right! Now I completely understand. Thank you RoryA.
 
Upvote 0
I think I may have missed that your first image in your first post is the one that works. I didn't realize that was the one you were talking about, as it did not look like the same formula.
When I originally opened the PDF, the menu options covered up the portion of your formula with the INDEX/MATCH formula.

Thanks for clearing it up, Rory!
That's perfectly fine Joe4, I have appreciated your continued assistance.
 
Upvote 0

Forum statistics

Threads
1,223,578
Messages
6,173,167
Members
452,504
Latest member
frankkeith2233

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