Index/Match Array, Multiple Column Array

agutts6

New Member
Joined
Jun 19, 2011
Messages
19
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.



inningout-101
1
03.32.35.4
116.53.14.5
125.00.53.0
204.44.14.6
212.23.35.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.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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
Joined
Jun 19, 2011
Messages
19
Thanks Aladdin.

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.

InningOuts1B-3-2-10123crit#form
1000.30310.37860.48580.58980.70410.7590.835Innings10.443
1110.33240.4260.54160.6290.7340.8190.874Outs1
2010.4020.4430.56320.65660.7490.8010.8741B1
3210.3980.5340.6010.69570.7740.7970.87Runs-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
Joined
Jun 29, 2009
Messages
7,256
Thanks Aladdin.

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.

InningOuts1B-3-2-10123crit#form
1000.30310.37860.48580.58980.70410.7590.835Innings10.443
1110.33240.4260.54160.6290.7340.8190.874Outs1
2010.4020.4430.56320.65660.7490.8010.8741B1
3210.3980.5340.6010.69570.7740.7970.87Runs-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.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
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.
 
Master Excel Bundle

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.

Forum statistics

Threads
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.
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
Top