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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
Not sure what you're asking exactly, every number would be between the minimum and the maximum number. Please clarify.
 
Upvote 0

DonkeyOte

MrExcel MVP
Joined
Sep 6, 2002
Messages
9,124
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

Cindy Ellis

MrExcel MVP
Joined
Jun 9, 2006
Messages
1,802
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,191,226
Messages
5,985,373
Members
439,961
Latest member
drose1105

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
Top