AVERAGE IF ABS(Range)>x

Gourav

New Member
Joined
Jan 9, 2012
Messages
11
Hi all,

I've been struggling with the COUNTIFS and AVERAGEIFS functions when dealing with the ABS function.

What I want to do is:

=COUNTIFS(Criteria_range1,criteria1,Criteria_range2,criteria2, etc...)

Which is working fine until I want to use the ABS function within this function, for example count if column A contains 1 and column D contains any number greater than 1. (same for average)


=COUNTIFS(A:A,1,D:D,">1") and =AVERAGEIFS(D:D,A:A,1,D:D,">1")

How can I amend this so I can change that second criteria to look at the absolute values stored in column D...

=COUNTIFS(A:A,1,ABS(D:D),">1") and =AVERAGEIFS(D:D,A:A,1,ABS(D:D),">1")

Doesn't work and I've been struggling with other ways of writing this so excel knows what I want it to do.

Can I use INDEX(ABS(D:D),0,1) somehow? I have used this to find a average, with other criteria..

=AVERAGE(IF(Criteria_Range1=Criteria1,INDEX(ABS(D:D),0,1)))
to give me the average of the Absolute values in D that meet the criteria, could I somehow use this to solve my issue.

Appreciate the assistance.

Gourav
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Sorry bit of a mistake....

should read...

Which is working fine until I want to use the ABS function within this function, for example count if column A contains 1 and the absolute value (in the cells) of column D contains any number greater than 1. (same for average)

Thanks again
 
Upvote 0
Hi all,

I've been struggling with the COUNTIFS and AVERAGEIFS functions when dealing with the ABS function.

What I want to do is:

=COUNTIFS(Criteria_range1,criteria1,Criteria_range2,criteria2, etc...)

Which is working fine until I want to use the ABS function within this function, for example count if column A contains 1 and column D contains any number greater than 1. (same for average)


=COUNTIFS(A:A,1,D:D,">1") and =AVERAGEIFS(D:D,A:A,1,D:D,">1")

How can I amend this so I can change that second criteria to look at the absolute values stored in column D...

=COUNTIFS(A:A,1,ABS(D:D),">1") and =AVERAGEIFS(D:D,A:A,1,ABS(D:D),">1")

Doesn't work and I've been struggling with other ways of writing this so excel knows what I want it to do.

Can I use INDEX(ABS(D:D),0,1) somehow? I have used this to find a average, with other criteria..

=AVERAGE(IF(Criteria_Range1=Criteria1,INDEX(ABS(D:D),0,1)))
to give me the average of the Absolute values in D that meet the criteria, could I somehow use this to solve my issue.

Appreciate the assistance.

Gourav
CountIf(s), SumIf(s), and AverageIf(s) do not process array objects, such as those that obtain from a transformation applied to range objects like:

MONTH(A2:A10)
LEFT(E2:E10)
ABS(D2:D10)

When a transformation is needed, one option is to switch to array formulas...

Control+shift+enter, not just enter:

=AVERAGE(IF(A2:A100=1,IF(ABS(D2:D100)>1,D2:D100)))

yields an average of D when A = 1 and ABS of D > 1.

=SUM(IF(A2:A100=1,IF(ABS(D2:D100)>1,1)))

yields a count.
 
Last edited:
Upvote 0
Hi,

Perhaps try:

For the COUNT:
=SUMPRODUCT((A1:A100=1)*(ABS(D1:D100)>1))

For the AVERAGE (this is an array formula so use CTRL-SHIFT-ENTER rather than just ENTER):
=AVERAGE(IF(A1:A100=1,IF(ABS(D1:D100)>1,D1:D100)))
 
Upvote 0
OK, not quite perfect...

I realised that when calculating the average, I need to use the ABS value of the values, I tried just doing this

{=AVERAGE(ABS(IF(A2:A100=1,IF(ABS(D2:D100)>1,D2:D100))))}

and

{=SUMPRODUCT(ABS(IF(A2:A100=1,IF(ABS(D2:D100)>1,D2:D100))))}

but that doesn't work. Any ideas?
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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