Index Match for a 2D array, but with a twist.

mister_m

New Member
Joined
Sep 16, 2023
Messages
11
Office Version
  1. 2019
  2. 2016
Platform
  1. Windows
Hello. I'm new here and thankful for the quick registration.
I've come up with an interesting challenge while trying to solve this issue at work.

Attached image for reference.

I have two inputs (let's say in cells M4 and M5). M4: required ratio
M5: required torque.
I have a matrix C3 to H8. This matrix has torques in incremental order horizontally.
Row 2 contains model names of gearboxes. (C2 to H2)

I need to find the closest match for gear ratio in column B. Then, the next highest value for torque, corresponding to that ratio. Then, the model name for that torque from the row C2 to H2.

This seemed fairly simple using INDEX MATCH but got insanely complicated due to the required criteria.
Let me know if you need additional information.
 

Attachments

  • IMG_20230916_124616.jpg
    IMG_20230916_124616.jpg
    71.7 KB · Views: 13

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
As an example, I input required ratio as 31 and torque as 21.
The result should be:
Selected ratio: 32 (because closest match)
Selected torque: 22 (next highest to required, in that row)
Gearbox model: MB4
 
Upvote 0
Define what you mean by closest for the ratio. Closest above, closest below or closest, irrespective of side.
 
Upvote 0
With ratio & torque in B14 & B15, respectively... try:

=INDEX(2:2,AGGREGATE(15,6,COLUMN(C2:H2)/(INDEX(C3:H8,MATCH(LOOKUP(0,0/FREQUENCY(0,ABS(B3:B8-B14)),B3:B8),B3:B8,0),)>=B15),1))
 
Upvote 1
Solution
With ratio & torque in B14 & B15, respectively... try:

=INDEX(2:2,AGGREGATE(15,6,COLUMN(C2:H2)/(INDEX(C3:H8,MATCH(LOOKUP(0,0/FREQUENCY(0,ABS(B3:B8-B14)),B3:B8),B3:B8,0),)>=B15),1))
Hmm.. I tried this one.
It results in error in value. Unsure of what's causing the issue.
 
Upvote 0
Unfortunately, I can not get the mini-sheet uploader to work for me... so I cannot post a working file. Try setting it as an array formula (just in case!!) with CTRL-SHIFT-ENTER.
 
Upvote 0
Ah. Sure, will do.
But do you mean, it's working for you?
Unfortunately, I can not get the mini-sheet uploader to work for me... so I cannot post a working file. Try setting it as an array formula (just in case!!) with CTRL-SHIFT-ENTER.
 
Upvote 0
Yes, it was fine (O365). I'm on the verge of abandoning Mr Excel, as I simply can't get the file uploader to work... no matter what I do.
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,975
Members
449,095
Latest member
Mr Hughes

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