How to generate an array of sorted results by omitting each element of operation (in this case AVERAGE)?

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

Part1:
I have 3 sets of 4 numbers as follows, such that I take the first number of each set and generate an average, then another average from the second numbers, an average from the third numbers, and finally an average from the fourth numbers. Then I take those "four" averages, and calculate a final average from those, and this is the final calculation that I need, which is so far, of course, very easy to do.

initial:
Q3=AVERAGE(B3,G3,L3)
R3=AVERAGE(C3,H3,M3)
S3=AVERAGE(D3,I3,N3)
T3=AVERAGE(E3,J3,O3)

Final:
V3=AVERAGE(Q3,R3,S3,T3)

A/1​
B​
C​
D​
E​
F​
G​
H​
I​
J​
K​
L​
M​
N​
O​
P​
2​
1​
2​
3​
4​
1​
2​
3​
4​
1​
2​
3​
4​
3​
43​
65​
98​
70​
32​
56​
71​
52​
78​
92​
23​
18​
4​


Part2:
Now, I want to exclude each of these 12 numbers, and see what the final result is, and this is the hard part (which I think would need some kind of array formula). I want to write a formula that I can spread in 12 cells, i.e. X3:AI3, such that each one of these 12 cells calculates the entire operation by excluding each number (in order). For example in cell X3, number B3 (i.e. 43) which is the first of the 12 numbers will be excluded from the operation, and the operation will become like this:

Final:
X3=AVERAGE(AVERAGE(--,G3,L3),AVERAGE(C3,H3,M3),AVERAGE(D3,I3,N3),AVERAGE(E3,J3,O3))
Y3=AVERAGE(AVERAGE(B3,--,L3),AVERAGE(C3,H3,M3),AVERAGE(D3,I3,N3),AVERAGE(E3,J3,O3))
.
.
.
AI3=AVERAGE(AVERAGE(B3,G3,L3),AVERAGE(C3,H3,M3),AVERAGE(D3,I3,N3),AVERAGE(E3,J3,--))

Part3:
Finally, in another set of 12 cells, i.e. AK3:AV3, I want the results of the previous step to be displayed in the order of larger to smaller starting at AK3. I want this step to be also done with a formula that I can spread from AK3 to AV3. (I hope to be able to handle this part with an INDEX formula which includes AGGREGATE which I saw at this link ():
)

I would highly appreciate any suggestions! Of course, if it is possible to combine parts 2 and 3 in a single range of 12 cells at X3:AI3, that's gonna be even enormously more fabulous ?

Thanks much!!!
 
Perhaps you could build on this? It assumes the numbers are grouped to start with (my Group1 is equal to your "firsts", for example) and that there is at least one number in each group.

ABCDEFGHIJKLMNOPQRSTUVWX
14-group AvG1 variancesAv1Av2Av3Av4Group1Group2Group3Group4
28.18758.37504.25005.00007.500016.000023572468369121112131
38.2917
48.1250
57.9583
6
7CHECK:
88.37505.00005.00007.500016.00003572468369121112131
98.29174.66675.00007.500016.00002572468369121112131
108.12504.00005.00007.500016.00002372468369121112131
117.95833.33335.00007.500016.00002352468369121112131
Sheet1
Cell Formulas
RangeFormula
A2A2=AVERAGE(D2:G2)
B2:B5B2=LET(N,4,g,FILTER(Group1,ISNUMBER(Group1)),c,COLUMNS(g),IFERROR(A2+TRANSPOSE(IF(c=1,(c*A2-g)/(N-1),((SUM(g)-g)/(c-1)-AVERAGE(g))/N)),"-"))
D2D2=IFERROR(AVERAGE(Group1),"")
E2E2=IFERROR(AVERAGE(Group2),"")
F2F2=IFERROR(AVERAGE(Group3),"")
G2G2=IFERROR(AVERAGE(Group4),"")
D8:D11D8=IFERROR(AVERAGE(I8:L8),"")
E8:E11E8=IFERROR(AVERAGE(M8:P8),"")
F8:F11F8=IFERROR(AVERAGE(Q8:T8),"")
G8:G11G8=IFERROR(AVERAGE(U8:X8),"")
B8:B11B8=AVERAGE(D8:G8)
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Group1=Sheet1!$I$2:$L$2D2, B2
Group2=Sheet1!$M$2:$P$2E2
Group3=Sheet1!$Q$2:$T$2F2
Group4=Sheet1!$U$2:$X$2G2


Example 2:

4-group AvG1 variancesAv1Av2Av3Av4Group1Group2Group3Group4
9.04179.37504.66673.00007.500021.00002572436912112131
9.0000
8.7500
CHECK:
9.37506.00003.00007.500021.0000572436912112131
9.00004.50003.00007.500021.0000272436912112131
8.75003.50003.00007.500021.0000252436912112131


Example 3:

4-group AvG1 variancesAv1Av2Av3Av4Group1Group2Group3Group4
8.00008.50005.00003.00003.000021.000037243112131
7.5000
CHECK:
8.50007.00003.00003.000021.00007243112131
7.50003.00003.00003.000021.00003243112131
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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