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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
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))
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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