Exclusive Averaging

JKFEagle

New Member
Joined
Apr 11, 2002
Messages
48
I'm looking for a way to average a series of numbers, filtering out everything outside a min and max. The data cannot be manipulated, sorted, etc. because it is linked to another file. Any ideas?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Not sure what you're asking exactly, every number would be between the minimum and the maximum number. Please clarify.
 
Upvote 0
entered as an array where > should be min and < should be max, alter range as required.

=AVERAGE(IF((A2:A10>1)*(A2:A10<5),A2:A10))

commit as array using SHIFT + CTRL + ENTER

will appear as

{=AVERAGE(....)}
 
Upvote 0
Without details of data location, size, etc., the following will have to be modified appropriately to fit your data and situation. I'm also not sure of the extent of user interaction vs. "hard-coded" information that you need, so please reply if the following doesn't do what you need. The following assumes data in cells A1:20, with cell references to the minimum and maximum values to INCLUDE in the calculation in D8 (minimum) and D9 (maximum):
Code:
=(SUMPRODUCT((A1:A20)*(A1:A20>=D8)*(A1:A20<=D9)))/((COUNTIF(A1:A20,">="&D8))-(COUNTIF(A1:A20,">"&D9)))
If you need help modifying this to fit your data, just reply back.
Cindy
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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