Multiple Conditions for Lookup (index/match) Columns

SBW87

New Member
Joined
Jan 22, 2019
Messages
2
Hi!

I am trying to return the size of a selection, when I specify the type and output required, which may not match the exact output, and therefore needs to find the closest match, for a certain type.

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Type[/TD]
[TD]Output[/TD]
[TD]Size[/TD]
[TD][/TD]
[TD]Type[/TD]
[TD]Single[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Single[/TD]
[TD]200[/TD]
[TD]300[/TD]
[TD][/TD]
[TD]Output[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Double[/TD]
[TD]100[/TD]
[TD]150[/TD]
[TD][/TD]
[TD]Size[/TD]
[TD]XXXX[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Single[/TD]
[TD]300[/TD]
[TD]450[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Double[/TD]
[TD]200[/TD]
[TD]300[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Any ideas would be greatly appreciated, many thanks.
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Welcome to Mr Excel forum

Try this array formula in F3
=INDEX(C$2:C$5,MATCH(MIN(IF(A$2:A$5=F1,ABS(B$2:B$5-F2))),IF(A$2:A$5=F1,ABS(B$2:B$5-F2)),0))
confirmed with Ctrl+Shift+Enter, not just Enter

Hope this helps

M.
 
Upvote 0
Thank you so much!

I think that has worked perfectly, would you mind, whenever you have time, explaining the main functions in the formula?
 
Upvote 0
You are welcome. Glad to help.

The formula uses built-in functions: INDEX, MATCH, MIN, IF, ABS
Take a look at the help file.

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,754
Messages
6,174,317
Members
452,555
Latest member
colc007

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