Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Steve
 
Posts: n/a
Default Formula to average ignoring negatives?

What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

That's not really ignoring the negatives, but this worked ok for me:

=AVERAGE(ABS(A1:A10))
This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

If you really wanted to ignore the negatives (pretend that they didn't exist):
=AVERAGE(IF(A1:A100,A1:A10))
This is also an array formula.

Steve wrote:

What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!


--

Dave Peterson
  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

And this array formula:
=AVERAGE(IF(A1:A100,A1:A10))
ignores 0's as well as negatives.

=AVERAGE(IF(A1:A10=0,A1:A10))
(array entered still, would ignore just the negatives)

==
Yeah, you didn't ask about this. I know. But I had to correct my error.

Dave Peterson wrote:

That's not really ignoring the negatives, but this worked ok for me:

=AVERAGE(ABS(A1:A10))
This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

If you really wanted to ignore the negatives (pretend that they didn't exist):
=AVERAGE(IF(A1:A100,A1:A10))
This is also an array formula.

Steve wrote:

What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!


--

Dave Peterson


--

Dave Peterson
  #4   Report Post  
Ragdyer
 
Posts: n/a
Default

Dave,

Those formulas don't seem to work right if there are blank (MT) cells in the
range!
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Dave Peterson" wrote in message
...
And this array formula:
=AVERAGE(IF(A1:A100,A1:A10))
ignores 0's as well as negatives.

=AVERAGE(IF(A1:A10=0,A1:A10))
(array entered still, would ignore just the negatives)

==
Yeah, you didn't ask about this. I know. But I had to correct my error.

Dave Peterson wrote:

That's not really ignoring the negatives, but this worked ok for me:

=AVERAGE(ABS(A1:A10))
This is an array formula. Hit ctrl-shift-enter instead of enter. If

you do it
correctly, excel will wrap curly brackets {} around your formula.

(don't type
them yourself.)

If you really wanted to ignore the negatives (pretend that they didn't

exist):
=AVERAGE(IF(A1:A100,A1:A10))
This is also an array formula.

Steve wrote:

What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!


--

Dave Peterson


--

Dave Peterson


  #5   Report Post  
Jerry W. Lewis
 
Posts: n/a
Default

=AVERAGE(IF(ISNUMBER(A1:A10)*(A1:A10=0),A1:A10))

Jerry

Ragdyer wrote:

Dave,

Those formulas don't seem to work right if there are blank (MT) cells in the
range!




  #6   Report Post  
Ragdyer
 
Posts: n/a
Default

Jerry,
Follow this scenario:
A1:A10
5,-6,2,13,2,-3,25,mt,mt,mt
OP's request - Average as if all numbers were positive.
Sum would equal 56.
Average would equal 8.

Your formula yields 9.4

Same scenario,
Dave's formulas return 5.6 - 5.875 - 9.4

--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Jerry W. Lewis" wrote in message
...
=AVERAGE(IF(ISNUMBER(A1:A10)*(A1:A10=0),A1:A10))

Jerry

Ragdyer wrote:

Dave,

Those formulas don't seem to work right if there are blank (MT) cells in

the
range!



  #7   Report Post  
Dave Peterson
 
Posts: n/a
Default

I didn't consider empty cells.

Another way that should work, though:

=AVERAGE(IF(ISNUMBER(A1:A10),ABS(A1:A10)))

(still array entered)

Ragdyer wrote:

Dave,

Those formulas don't seem to work right if there are blank (MT) cells in the
range!
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Dave Peterson" wrote in message
...
And this array formula:
=AVERAGE(IF(A1:A100,A1:A10))
ignores 0's as well as negatives.

=AVERAGE(IF(A1:A10=0,A1:A10))
(array entered still, would ignore just the negatives)

==
Yeah, you didn't ask about this. I know. But I had to correct my error.

Dave Peterson wrote:

That's not really ignoring the negatives, but this worked ok for me:

=AVERAGE(ABS(A1:A10))
This is an array formula. Hit ctrl-shift-enter instead of enter. If

you do it
correctly, excel will wrap curly brackets {} around your formula.

(don't type
them yourself.)

If you really wanted to ignore the negatives (pretend that they didn't

exist):
=AVERAGE(IF(A1:A100,A1:A10))
This is also an array formula.

Steve wrote:

What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Steve
 
Posts: n/a
Default

Dave Peterson wrote:
=AVERAGE(ABS(A1:A10))
This is an array formula. Hit ctrl-shift-enter instead of enter.


Thanks everyone. This one looks to be the easiest, and seems to do
the trick.

  #9   Report Post  
Ragdyer
 
Posts: n/a
Default

One way is with this array formula:

=SUM(ABS(A1:A10))/COUNT(A1:A10)

Must be entered with CSE (<Ctrl <Shift <Enter),
Which will make XL *automatically* enclose the formula in curly brackets,
Which cannot be done manually.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"Steve" wrote in message
...
What formula would I use to average a group of numbers and ignore the
negatives? For instance, if I'm averaging +8 and -6, I want the
result to be 7, not 1. Thanks!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting an Excel formula to an Access query formula Adam Excel Discussion (Misc queries) 1 December 15th 04 03:38 AM
I want the results of a formula to show in cell, NOT THE FORMULA! ocbecky Excel Discussion (Misc queries) 4 December 10th 04 08:39 PM
Paste is is copying in formula, but display is wrong. Matt Excel Discussion (Misc queries) 2 December 7th 04 08:37 PM
Excel2K: Is it possible to use dynamic named ranges in custom data validation formula? Arvi Laanemets Excel Discussion (Misc queries) 0 December 2nd 04 11:29 AM
Averaging only cells with data Randy Lefferts Excel Discussion (Misc queries) 9 November 30th 04 08:02 PM


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"