Matching multiple k's for small function to get average

dbcooper88

New Member
Joined
Dec 3, 2016
Messages
36
Column E has data Im looking for that matches with column O. Looking for the 4 smallest numbers in column O that match with column E. Want to average the next numbers of matching column E. Heres what Ive come up with for one match:

=INDEX(E4:E66,MATCH(SMALL(O$4:O66,2),O4:O66,0)+1,1)

TIA
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Excel 2010
EOPQ
1NameNumber
2Z32Z13
3W8614
4E7730
5Z3032
6T14
7Y87
8U5
9Z14
10O92
11P70
12A27
13Z75
14Z57
15F61
16G18
17H88
18J25
19Z63
20L76
21Z13
Sheet9
Cell Formulas
RangeFormula
Q2{=SMALL(IF($E$2:$E$21=$P$2,$O$2:$O$21),ROW(A1))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Excel 2010
EOPQ
NameNumber
ZZ
W
E
Z
T
Y
U
Z
O
P
A
Z
Z
F
G
H
J
Z
L
Z

<colgroup><col style="width: 25pxpx"><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]2[/TD]

[TD="align: right"]32[/TD]

[TD="align: right"]13[/TD]

[TD="align: center"]3[/TD]

[TD="align: right"]86[/TD]
[TD="align: right"][/TD]
[TD="align: right"]14[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]77[/TD]
[TD="align: right"][/TD]
[TD="align: right"]30[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"]30[/TD]
[TD="align: right"][/TD]
[TD="align: right"]32[/TD]

[TD="align: center"]6[/TD]

[TD="align: right"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]7[/TD]

[TD="align: right"]87[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]8[/TD]

[TD="align: right"]5[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]9[/TD]

[TD="align: right"]14[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]10[/TD]

[TD="align: right"]92[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]11[/TD]

[TD="align: right"]70[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]12[/TD]

[TD="align: right"]27[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]13[/TD]

[TD="align: right"]75[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]14[/TD]

[TD="align: right"]57[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]15[/TD]

[TD="align: right"]61[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]16[/TD]

[TD="align: right"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]17[/TD]

[TD="align: right"]88[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]18[/TD]

[TD="align: right"]25[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]19[/TD]

[TD="align: right"]63[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]20[/TD]

[TD="align: right"]76[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]21[/TD]

[TD="align: right"]13[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

</tbody>
Sheet9

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]Q2[/TH]
[TD="align: left"]{=SMALL(IF($E$2:$E$21=$P$2,$O$2:$O$21),ROW(A1))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]

Looking for an average of the E's. Your E's arent even numbers. Please reread first post.
 
Upvote 0
dbcooper88,
Could you please post an example of your data and the desired result?


E
O
1
6
5
2
6
6
3
4
3
4
5
2
5
5
4
6
1
7
7
2
8
8
4
1

<tbody>
</tbody>

Want to average the numbers in E that match with the 2nd, 3rd, 4th and 5th smallest numbers in column O. But I want to average the next number in E. So in the above example want the result to be for column E the average of 6,5,5,1. Heres what Ive come up with for one match for 2nd smallest:

=INDEX(E4:E66,MATCH(SMALL(O$4:O66,2),O4:O66,0)+1,1)
 
Upvote 0
Want to average the numbers in E that match with the 2nd, 3rd, 4th and 5th smallest numbers in column O. But I want to average the next number in E. So in the above example want the result to be for column E the average of 6,5,5,1. Heres what Ive come up with for one match for 2nd smallest:

=INDEX(E4:E66,MATCH(SMALL(O$4:O66,2),O4:O66,0)+1,1)

I don't understand how your description matches your desired result.

The 2nd,3rd,4th and 5th smallest numbers in column O are 2, 3, 4 and 5.
The numbers in column E on those rows are 5, 4, 5 and 6.
Which aren't the numbers that you say you want averaged.
 
Last edited:
Upvote 0
I don't understand how your description matches your desired result.

The 2nd,3rd,4th and 5th smallest numbers in column O are 2, 3, 4 and 5.
The numbers in column E on those rows are 5, 4, 5 and 6.
Which aren't the numbers that you say you want averaged.

Want to average the next numbers of the matching rows/numbers.
 
Upvote 0
bC3Dqhx.png
 
Upvote 0
Something like:


Excel 2010
EFG
1Series1Series2
265
366
443
552
654
717
828
941
10
114.25
Sheet10 (2)
Cell Formulas
RangeFormula
E11{=AVERAGE(IF(ISNUMBER(MATCH($G$2:$G$9,SMALL($G$2:$G$9,{2;3;4;5}),0)),OFFSET($E$2:$E$9,1,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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