Index & Match With Multiple Columns

drcolinb

New Member
Joined
Mar 2, 2015
Messages
2
I would like to use index and match with multiple columns. For example, using the data below, I want to index column B by searching for the values in column D in the array F1:H12.

So, index(B1:B12, match(D1, F1:H12, 0)) would return April.

I realise that match() does not work with multiple columns. Is there some way of modifying the function to deal with this issue?

Any help would be greatly appreciated!

ABCDEFGH I
1JanuaryCLB-FC-2D-ST-SPA-4001-01CLB-FC-2D-ST-SPA-4101-01CLB-FC-2D-ST-SPA-4102-01CLB-FC-2D-ST-SPA-4101-02=index(B1:B12, match(D1, F1:H12, 0)
2FebruaryCLB-FC-2D-ST-SPA-4002-01CLB-FC-2D-ST-SPA-4201-01CLB-FC-2D-ST-SPA-4202-01CLB-FC-2D-ST-SPA-4201-02=index(B1:B12, match(D2, F1:H12, 0)
3MarchCLB-FC-2D-ST-SPA-4003-01CLB-FC-2D-ST-SPA-4301-01CLB-FC-2D-ST-SPA-4302-01CLB-FC-2D-ST-SPA-4301-02
4AprilCLB-FC-2D-ST-SPA-4004-01CLB-FC-2D-ST-SPA-4001-01CLB-FC-2D-ST-SPA-4002-01CLB-FC-2D-ST-SPA-4001-02
5MayCLB-FC-2D-ST-SPA-4005-01CLB-FC-2D-ST-SPA-4003-01CLB-FC-2D-ST-SPA-4004-01CLB-FC-2D-ST-SPA-4003-02
6JuneCLB-FC-2D-ST-SPA-4101-02CLB-FC-2D-ST-SPA-4005-01CLB-FC-2D-ST-SPA-4102-02CLB-FC-2D-ST-SPA-4005-02
7JulyCLB-FC-2D-ST-SPA-4007-01CLB-FC-2D-ST-SPA-4006-01CLB-FC-2D-ST-SPA-4202-02CLB-FC-2D-ST-SPA-4006-02
8AugustCLB-FC-2D-ST-SPA-4008-01CLB-FC-2D-ST-SPA-4007-01CLB-FC-2D-ST-SPA-4302-02CLB-FC-2D-ST-SPA-4007-02
9SeptemberCLB-FC-2D-ST-SPA-4011-02CLB-FC-2D-ST-SPA-4008-01CLB-FC-2D-ST-SPA-4002-02CLB-FC-2D-ST-SPA-4008-02
10OctoberCLB-FC-2D-ST-SPA-4010-01CLB-FC-2D-ST-SPA-4009-01CLB-FC-2D-ST-SPA-4004-02CLB-FC-2D-ST-SPA-4009-02
11NovemberCLB-FC-2D-ST-SPA-4001-02CLB-FC-2D-ST-SPA-4010-01CLB-FC-2D-ST-SPA-4005-03CLB-FC-2D-ST-SPA-4010-02
12DecemberCLB-FC-2D-ST-SPA-4102-01CLB-FC-2D-ST-SPA-4011-01CLB-FC-2D-ST-SPA-4006-03CLB-FC-2D-ST-SPA-4011-02

<tbody>
</tbody>
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Welcome to the forum

try this array formula, confirm with Ctrl+Shift+Enter

Code:
=INDEX($B$2:$B$13,SMALL(IF($F$2:$H$13=D2,ROW($F$2:$H$13)-ROW($F$2)+1),1))
 
Upvote 0
Try
=INDEX(A1:A12,IFERROR(MATCH(B1,C1:C12,0),IFERROR(MATCH(B1,D1:D12,0),IFERROR(MATCH(B1,E1:E12,0),""))))
 
Last edited:
Upvote 0
drcolinb,

In respect of your posted data set try...

Excel 2007
BCDEFGHIJ
1JanuaryCLB-FC-2D-ST-SPA-4001-01CLB-FC-2D-ST-SPA-4101-01CLB-FC-2D-ST-SPA-4102-01CLB-FC-2D-ST-SPA-4101-02April
2FebruaryCLB-FC-2D-ST-SPA-4002-01CLB-FC-2D-ST-SPA-4201-01CLB-FC-2D-ST-SPA-4202-01CLB-FC-2D-ST-SPA-4201-02April
3MarchCLB-FC-2D-ST-SPA-4003-01CLB-FC-2D-ST-SPA-4301-01CLB-FC-2D-ST-SPA-4302-01CLB-FC-2D-ST-SPA-4301-02May
4AprilCLB-FC-2D-ST-SPA-4004-01CLB-FC-2D-ST-SPA-4001-01CLB-FC-2D-ST-SPA-4002-01CLB-FC-2D-ST-SPA-4001-02May
5MayCLB-FC-2D-ST-SPA-4005-01CLB-FC-2D-ST-SPA-4003-01CLB-FC-2D-ST-SPA-4004-01CLB-FC-2D-ST-SPA-4003-02June
6JuneCLB-FC-2D-ST-SPA-4101-02CLB-FC-2D-ST-SPA-4005-01CLB-FC-2D-ST-SPA-4102-02CLB-FC-2D-ST-SPA-4005-02January
7JulyCLB-FC-2D-ST-SPA-4007-01CLB-FC-2D-ST-SPA-4006-01CLB-FC-2D-ST-SPA-4202-02CLB-FC-2D-ST-SPA-4006-02August
8AugustCLB-FC-2D-ST-SPA-4008-01CLB-FC-2D-ST-SPA-4007-01CLB-FC-2D-ST-SPA-4302-02CLB-FC-2D-ST-SPA-4007-02September
9SeptemberCLB-FC-2D-ST-SPA-4011-02CLB-FC-2D-ST-SPA-4008-01CLB-FC-2D-ST-SPA-4002-02CLB-FC-2D-ST-SPA-4008-02December
10OctoberCLB-FC-2D-ST-SPA-4010-01CLB-FC-2D-ST-SPA-4009-01CLB-FC-2D-ST-SPA-4004-02CLB-FC-2D-ST-SPA-4009-02November
11NovemberCLB-FC-2D-ST-SPA-4001-02CLB-FC-2D-ST-SPA-4010-01CLB-FC-2D-ST-SPA-4005-03CLB-FC-2D-ST-SPA-4010-02April
12DecemberCLB-FC-2D-ST-SPA-4102-01CLB-FC-2D-ST-SPA-4011-01CLB-FC-2D-ST-SPA-4006-03CLB-FC-2D-ST-SPA-4011-02January
Sheet2
Cell Formulas
RangeFormula
J1{=INDEX($B$1:$B$12,MAX(($F$1:$H$12=D1)*ROW($F$1:$H$12)),)}
Press CTRL+SHIFT+ENTER to enter array formulas.


Hope that helps.
 
Upvote 0
Thank you! That is exactly what I needed.

In reality, there are many columns to search, so both of the array formulas work great :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,202
Members
448,554
Latest member
Gleisner2

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