Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10
Default How can I change all negative values in a column to = 0?

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!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default How can I change all negative values in a column to = 0?

=AVERAGE(IF(A1:A200,A1:A20))

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

--
HTH

Bob Phillips

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

"dbsavoy" wrote in message
...
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!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default How can I change all negative values in a column to = 0?

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:A100,A1:A10))

To exclude negatives *BUT* include zero's:

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

Biff

"dbsavoy" wrote in message
...
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!



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
DKS DKS is offline
external usenet poster
 
Posts: 103
Default How can I change all negative values in a column to = 0?

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.



"dbsavoy" wrote:

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!

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
Return SEARCHED Column Number of Numeric Label and Value Sam via OfficeKB.com Excel Worksheet Functions 23 January 30th 06 06:16 PM
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
creating a bar graph Johnfli Excel Discussion (Misc queries) 0 October 26th 05 08:16 PM
how do i sum up a column of time values but ignore negative values Croll New Users to Excel 1 October 11th 05 05:55 PM
Pbl calculating US$ values Joseph Excel Discussion (Misc queries) 1 July 13th 05 04:28 PM


All times are GMT +1. The time now is 08:28 PM.

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

About Us

"It's about Microsoft Excel"