Average with large and small function

rexysri

New Member
Joined
Mar 2, 2016
Messages
27
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
Platform
  1. Windows
  2. Mobile
Hello lovely humans,

I'm trying to average the values of column-B, C, & D based on top-3 values of Column-E.
Dean wise averages i want . Here i am attaching a pic plz help me

Capture.JPG
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi Rexysri,

It is not completely clear to me your assignment, but I think the formulas below can give you some idea:unsure:
Capture.JPG
 
Upvote 0
For the future, you are likely to get much faster responses if you provide your sample data and results with XL2BB so that helpers do not have to manually type it out to test. ;)

Since you have M/Soft 365, you could also try these.

22 04 03.xlsm
ABCDEFGHIJKL
1
2HYD344157133HYD344746127
3HYD365443132KNL455359157
4HYD324539116
5HYD314044115HYD314546122
6HYD244546114KNL444857150
7KNL446157161
8KNL494961159
9KNL415060151
10KNL463955141
11KNL414254138
Averages
Cell Formulas
RangeFormula
I2:L3I2=ROUND(AVERAGE(INDEX(FILTER(B$2:B$11,$A$2:$A$11=$H2),SEQUENCE(3))),0)
I5:L6I5=ROUND(AVERAGE(INDEX(FILTER(B$2:B$11,$A$2:$A$11=$H5),SEQUENCE(5))),0)
 
Upvote 0
For the future, you are likely to get much faster responses if you provide your sample data and results with XL2BB so that helpers do not have to manually type it out to test. ;)

Since you have M/Soft 365, you could also try these.

22 04 03.xlsm
ABCDEFGHIJKL
1
2HYD344157133HYD344746127
3HYD365443132KNL455359157
4HYD324539116
5HYD314044115HYD314546122
6HYD244546114KNL444857150
7KNL446157161
8KNL494961159
9KNL415060151
10KNL463955141
11KNL414254138
Averages
Cell Formulas
RangeFormula
I2:L3I2=ROUND(AVERAGE(INDEX(FILTER(B$2:B$11,$A$2:$A$11=$H2),SEQUENCE(3))),0)
I5:L6I5=ROUND(AVERAGE(INDEX(FILTER(B$2:B$11,$A$2:$A$11=$H5),SEQUENCE(5))),0)


Hi peter thanks for your reply, your formula working good but here, first we have to check largest three values in column E, in example file i sorted the Column E and top-3 and 5 averages was taken. Here i want the averages without sorting the Column E.

Thanking you
 
Upvote 0
in example file i sorted the Column E ..... Here i want the averages without sorting the Column E.
Important to make your sample data representative of your actual data. ;)

We do not know anything about your data other that what you show us or tell us so if you show us sorted data, we assume that your data is sorted. :cool:

Try this instead

22 04 03.xlsm
ABCDEFGHIJKL
1
2KNL446157161HYD344746127
3KNL415060151KNL455359157
4HYD244546114
5HYD324539116HYD314546122
6KNL463955141KNL444857150
7HYD365443132
8HYD344157133
9HYD314044115
10KNL494961159
11KNL414254138
Averages (2)
Cell Formulas
RangeFormula
I2:L3I2=LET(rws,$A$2:$A$11=$H2,ROUND(AVERAGE(INDEX(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),SEQUENCE(3))),0))
I5:L6I5=LET(rws,$A$2:$A$11=$H5,ROUND(AVERAGE(INDEX(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),SEQUENCE(5))),0))
 
Upvote 0
Important to make your sample data representative of your actual data. ;)

We do not know anything about your data other that what you show us or tell us so if you show us sorted data, we assume that your data is sorted. :cool:

Try this instead
It's Working Peter brother thank you soo much
 
Upvote 0
You're welcome. Thanks for the confirmation. :)
 
Upvote 0
You may not have it yet but the new TAKE() function allows a slightly better way than INDEX/SEQUENCE to 'take' the first 3 (or 5) values to calculate with.

22 04 03.xlsm
ABCDEFGHIJKL
1
2KNL446157161HYD344746127
3KNL415060151KNL455359157
4HYD244546114
5HYD324539116HYD314546122
6KNL463955141KNL444857150
7HYD365443132
8HYD344157133
9HYD314044115
10KNL494961159
11KNL414254138
Averages (3)
Cell Formulas
RangeFormula
I2:L3I2=LET(rws,$A$2:$A$11=$H2,ROUND(AVERAGE(TAKE(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),3)),0))
I5:L6I5=LET(rws,$A$2:$A$11=$H5,ROUND(AVERAGE(TAKE(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),5)),0))
 
Upvote 0
You may not have it yet but the new TAKE() function allows a slightly better way than INDEX/SEQUENCE to 'take' the first 3 (or 5) values to calculate with.

22 04 03.xlsm
ABCDEFGHIJKL
1
2KNL446157161HYD344746127
3KNL415060151KNL455359157
4HYD244546114
5HYD324539116HYD314546122
6KNL463955141KNL444857150
7HYD365443132
8HYD344157133
9HYD314044115
10KNL494961159
11KNL414254138
Averages (3)
Cell Formulas
RangeFormula
I2:L3I2=LET(rws,$A$2:$A$11=$H2,ROUND(AVERAGE(TAKE(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),3)),0))
I5:L6I5=LET(rws,$A$2:$A$11=$H5,ROUND(AVERAGE(TAKE(SORTBY(FILTER(B$2:B$11,rws),FILTER($E$2:$E$11,rws),-1),5)),0))

thx for updating peter. another query .. how to average least 3 or 5 values with the same condition
can u plz tell
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,688
Members
449,117
Latest member
Aaagu

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