Dynamic Top/bottom calculation

alizok

Board Regular
Joined
Sep 12, 2002
Messages
88
Office Version
  1. 365
I need the assistance of this group in developing a formula that will dynamically modify dependent on the number of records in the database. I need to figure out the top 10%, top 25%, top 30%, bottom 10%, bottom 25%, and so on. Is there a formula that can automatically calculate this information? Typically, I rank the data, then sort it from smallest to largest, and then determine the average of a certain data set manually depending on the percentage. see attached for more details.

Thank you in advance for all your help
 

Attachments

  • excel_TOP_BOTTOM.png
    excel_TOP_BOTTOM.png
    39.7 KB · Views: 33

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Try this:
(Cannot have any extraneoius data in column A.)
Cell Formulas
RangeFormula
B3:D52B3=IF(ROWS($A$3:A3)>COUNTA($A:$A)*(B$2/100),"", AGGREGATE(14,4,$A:$A, COUNTA($A$3:$A3)))
E3:G52E3=IF(ROWS($A$3:D3)>COUNTA($A:$A)*(E$2/100),"", AGGREGATE(15,4,$A:$A, COUNTA($A$3:$A3)))
 
Upvote 0
Try this:
(Cannot have any extraneoius data in column A.)
Cell Formulas
RangeFormula
B3:D52B3=IF(ROWS($A$3:A3)>COUNTA($A:$A)*(B$2/100),"", AGGREGATE(14,4,$A:$A, COUNTA($A$3:$A3)))
E3:G52E3=IF(ROWS($A$3:D3)>COUNTA($A:$A)*(E$2/100),"", AGGREGATE(15,4,$A:$A, COUNTA($A$3:$A3)))
(the above will not list all ties of the last of the nths.)
 
Upvote 0
also for the above you need excel 2010 or greater, maybe 2013. Because it uses the aggregate functions.
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
I have updated my record Microsoft 365 - thank you.
 
Upvote 0
(the above will not list all ties of the last of the nths.)
thank you for the formula but I'm not sure if it's doing what I'm looking for. I just simply need to enter the count of records in the row and then the excel knows to calculate the average of the top or bottom records. In your example, if I'm looking for the top 10% the result should be 256.29
 
Upvote 0
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 

Attachments

  • Screenshot 2023-03-06 121048.png
    Screenshot 2023-03-06 121048.png
    58.3 KB · Views: 18
Upvote 0
That is an image, please post the actual data as requested.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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