average unique values with conditions

roofman6

New Member
Joined
Dec 25, 2014
Messages
23
I would like to average the unique values in B1:Z1 if they are >-.5 and <.5 and <>0. Is there a formula that would do this?

Thanks in advance
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
I would like to average the unique values in B1:Z1 if they are >-.5 and <.5 and <>0. Is there a formula that would do this?

Thanks in advance

Where is your sample?

0.4,0.4,0.2,0.6,0.4,0,-0.4

What is the expected value? Not that excluding real 0's from -N to +N is considered unsound when averaging.
 
Upvote 0
Sorry about not including a sample. Here are some numbers:
-.1, .2, 0, .4, .4, -.6... with an expected average of the unique values (-.1+.2+.4)/3=.167
Thanks again
 
Upvote 0
Sorry about not including a sample. Here are some numbers:
-.1, .2, 0, .4, .4, -.6... with an expected average of the unique values (-.1+.2+.4)/3=.167
Thanks again

Control+shift+enter, not just enter:

=AVERAGE(IF(FREQUENCY(IF(ISNUMBER(1/B1:Z1),MATCH(B1:Z1,B1:Z1,0)),COLUMN(B1:Z1)-COLUMN(B1)+1),TRANSPOSE(B1:Z1)))
 
Upvote 0
Aladin,

I tried it and I get an average of -.025. I'm wondering where the conditions of >-.5, <.5, and <>0 are in your formula.
Here's the abbreviated formula in A1 with those -.1, .2, 0, .4, .4, -.6 in B1 thru G1
=AVERAGE(IF(FREQUENCY(IF(ISNUMBER(1/B1:G1),MATCH(B1:G1,B1:G1,0)),COLUMN(B1:G1)-COLUMN(B1)+1),TRANSPOSE(B1:G1)))
Am I doing something wrong?

Thanks
 
Last edited:
Upvote 0
Aladin,

I tried it and I get an average of -.025. I'm wondering where the conditions of >-.5, <.5, and <>0 are in your formula.
Here's the abbreviated formula in A1 with those -.1, .2, 0, .4, .4, -.6 in B1 thru G1
=AVERAGE(IF(FREQUENCY(IF(ISNUMBER(1/B1:G1),MATCH(B1:G1,B1:G1,0)),COLUMN(B1:G1)-COLUMN(B1)+1),TRANSPOSE(B1:G1)))
Am I doing something wrong?

Thanks

Forgat to include those conditions...

Control+shift+enter:
Rich (BB code):
=AVERAGE(IF(FREQUENCY(IF(ISNUMBER(1/B1:Z1),IF(B1:Z1 > -0.5,IF(B1:Z1 < 0.5,MATCH(B1:Z1,B1:Z1,0)))),
    COLUMN(B1:Z1)-COLUMN(B1)+1),TRANSPOSE(B1:Z1)))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,494
Messages
6,130,977
Members
449,611
Latest member
Bushra

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