Calculate average of mid-range

I am looking to find the average of the middle 50% of a range - excluding the lower 25% and the upper 25%. I am trying to add the formula into a metric sheet, so the formula would reference another sheet. Here is what I thought would work but does not:
=AVERAGEIF({Permit issued to constr start}, ">= " & PERCENTILE({Permit issued to constr start}, 0.25), {Permit issued to constr start}, "<= " & PERCENTILE({Permit issued to constr start}, 0.75))
Help
Best Answer
-
Hi Mark,
You have the right idea, you're just running into a few formatting issues. The first problem is you're trying to pass multiple criteria to AVERAGEIF which only accepts one. To pass multiple criteria (simulating an AVERAGEIFS()) you need to use COLLECT() inside AVG(). Additionally, it is not necessary to use quotation marks around your logical operators. Rewriting the formula as follows should work.
=AVG(COLLECT({Permit issued to constr start}, {Permit issued to constr start}, >=PERCENTILE({Permit issued to constr start}, .25), {Permit issued to constr start}, < = PERCENTILE({Permit issued to constr start}, .75)))
Answers
-
Hi Mark,
You have the right idea, you're just running into a few formatting issues. The first problem is you're trying to pass multiple criteria to AVERAGEIF which only accepts one. To pass multiple criteria (simulating an AVERAGEIFS()) you need to use COLLECT() inside AVG(). Additionally, it is not necessary to use quotation marks around your logical operators. Rewriting the formula as follows should work.
=AVG(COLLECT({Permit issued to constr start}, {Permit issued to constr start}, >=PERCENTILE({Permit issued to constr start}, .25), {Permit issued to constr start}, < = PERCENTILE({Permit issued to constr start}, .75)))
-
Amazing, thank you, you just save me some brain cells.
Your formula worked perfectly!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.5K Get Help
- 466 Global Discussions
- 156 Industry Talk
- 510 Announcements
- 5.5K Ideas & Feature Requests
- 87 Brandfolder
- 156 Just for fun
- 81 Community Job Board
- 520 Show & Tell
- 35 Member Spotlight
- 3 SmartStories
- 307 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!