Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / August 2006

Tip: Looking for answers? Try searching our database.

How can I change all negative values in a column to = 0?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dbsavoy - 21 Aug 2006 19:52 GMT
I'm trying to calculate an average of data, but need to ignore negative
numbers in the range from which I'm taking the average.  I'd like to either
format cells to calculate based on displayed values rather than actual values
OR use something like an IF function to change negative values into zeros or
NA.

I would much appreciate any help on this.
Thx!
Bob Phillips - 21 Aug 2006 20:07 GMT
=AVERAGE(IF(A1:A20>0,A1:A20))

which is an array formula, it should be committed with Ctrl-Shift-Enter, not
just Enter.

Signature

HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

> I'm trying to calculate an average of data, but need to ignore negative
> numbers in the range from which I'm taking the average.  I'd like to either
[quoted text clipped - 4 lines]
> I would much appreciate any help on this.
> Thx!
Biff - 21 Aug 2006 20:10 GMT
Hi!

To get the average that excludes negative values *AND* zero values:

Both formulas entered as an array using the key combination of
CTRL,SHIFT,ENTER (not just ENTER):

=AVERAGE(IF(A1:A10>0,A1:A10))

To exclude negatives *BUT* include zero's:

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

Biff

> I'm trying to calculate an average of data, but need to ignore negative
> numbers in the range from which I'm taking the average.  I'd like to
[quoted text clipped - 7 lines]
> I would much appreciate any help on this.
> Thx!
DKS - 21 Aug 2006 20:14 GMT
I would add a dummy column next to the column you want to be averaged.  

Let us assume that your real data is in column A, then I would add a column
B with following formula in cell B1 = ABS(A1).  This formula of course is to
be copied in the entire range of column B that you need to be averaged.  
Thereafter apply your average formula on column B.

You can always Hide Column B to avoid display of dummy data.  The average
formula can be displayed in column A or any other visibile column.

> I'm trying to calculate an average of data, but need to ignore negative
> numbers in the range from which I'm taking the average.  I'd like to either
[quoted text clipped - 4 lines]
> I would much appreciate any help on this.
> Thx!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.