# Index/Match Array, Multiple Column Array

#### agutts6

##### New Member
Hey guys,

As a moderate noob where arrays are concerned, I could use some guidance here. Pretty sure this would fall under the index/match function, but if there's a simpler way to arrive at a solution, I'm of course all ears.

 inning out -1 0 1 1 0 3.3 2.3 5.4 1 1 6.5 3.1 4.5 1 2 5 0.5 3 2 0 4.4 4.1 4.6 2 1 2.2 3.3 5.5

<tbody>
</tbody>

Let's say the column headings "-1, 0, 1" refer to a game score.

I know how to do an array function using the inning and out columns to return a value from the center (0) column. For example, if inning = 2 and out = 0, use array index/match to return column 0 value of 4.1.

But can I also use the columns as a criteria? As in, index columns -1 through 1, and match based on say, inning = 2 outs = 0 game score = -1?

I hope I'm explaining this well enough. Please let me know.

### Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

##### MrExcel MVP
Let F2 equal 2 (an inning value), G2 0 (an out value), H2 1 (a column heading)...

I2, control+shift+enter, not just enter:

=INDEX(C2:E6,MATCH(1,IF(A2:A6=F2,IF(B2:B6=G2,1)),0),MATCH(H2,C1:E1,0))

#### agutts6

##### New Member

Works the way you showed me. But I was demo-ing an abridged version there for simplicity. Here's my full version. It's sort of working, but it's off.

 Inning Outs 1B -3 -2 -1 0 1 2 3 crit # form 1 0 0 0.3031 0.3786 0.4858 0.5898 0.7041 0.759 0.835 Innings 1 0.443 1 1 1 0.3324 0.426 0.5416 0.629 0.734 0.819 0.874 Outs 1 2 0 1 0.402 0.443 0.5632 0.6566 0.749 0.801 0.874 1B 1 3 2 1 0.398 0.534 0.601 0.6957 0.774 0.797 0.87 Runs -2

<colgroup><col width="64" span="3" style="width:48pt"> <col width="64" style="width:48pt"> <col width="64" span="9" style="width:48pt"> </colgroup><tbody>
</tbody>

Formula is =INDEX(D2:J5,MATCH(1,IF(A:A=L2,IF(B:B=L3,IF(C:C=L4,1))),0),MATCH(L5,D1:J1,0)) . That's returning .443, which is a little off. If I turn the inputs a little... innings 2, outs 0, 1b 1, runs -2.... same problem, returns .534.

Sorry for leaving out some details in the original, but I thought what worked for one wouldve worked for the other.

#### Robert Mika

##### MrExcel MVP

Works the way you showed me. But I was demo-ing an abridged version there for simplicity. Here's my full version. It's sort of working, but it's off.

 Inning Outs 1B -3 -2 -1 0 1 2 3 crit # form 1 0 0 0.3031 0.3786 0.4858 0.5898 0.7041 0.759 0.835 Innings 1 0.443 1 1 1 0.3324 0.426 0.5416 0.629 0.734 0.819 0.874 Outs 1 2 0 1 0.402 0.443 0.5632 0.6566 0.749 0.801 0.874 1B 1 3 2 1 0.398 0.534 0.601 0.6957 0.774 0.797 0.87 Runs -2

<tbody>
</tbody>

Formula is =INDEX(D2:J5,MATCH(1,IF(A:A=L2,IF(B:B=L3,IF(C:C=L4,1))),0),MATCH(L5,D1:J1,0)) . That's returning .443, which is a little off. If I turn the inputs a little... innings 2, outs 0, 1b 1, runs -2.... same problem, returns .534.

Sorry for leaving out some details in the original, but I thought what worked for one wouldve worked for the other.

Excel 2010
ABCDEFGHIJKLM
1InningOuts1B-3-2-10123crit#form
21000.30310.37860.48580.58980.70410.7590.835Innings10.426
31110.33240.4260.54160.6290.7340.8190.874Outs1
42010.4020.4430.56320.65660.7490.8010.8741B1
53210.3980.5340.6010.69570.7740.7970.87Runs-2
Sheet2
Cell Formulas
RangeFormula
M2{=INDEX(D2:J5,MATCH(1,IF(A2:A100=L2,IF(B2:B100=L3,IF(C2:C100=L4,1))),0),MATCH(L5,D1:J1,0))}
Press CTRL+SHIFT+ENTER to enter array formulas.

Your formulas IF's functions should have started in row 2.
BTW do not use whole column range unless absolutely necessary as this will slow down your calculation.
Maybe not seen at 1 formula level but will definitely be seen if you had few of them.

#### agutts6

Allahu Ahkbar.

##### MrExcel MVP
Allahu Ahkbar.

I propose a modification which makes the formula a tad faster (this would also hold for the shorter/initial version)...

=INDEX(D2:J5,MATCH(1,IF(A2:A100=L2,IF(B2:B100=L3,IF(C2:C100=L4,1))),0),MATCH(L5,D1:J1,1))

Confirming with control+shift+enter is still required.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,167,747
Messages
5,855,437
Members
431,732
Latest member
albertdi827

### 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.

### Which adblocker are you using?

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

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