#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Countif

I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default Countif

I just did a test and the formula seemed to work to me, when you say the
formula returns 6, you are just talking about the countif part and not the
whole formula correct? Because if you had a 6 and all the rest as zeros the
result would be 6 no?

"Joeredmm" wrote:

I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 695
Default Countif

maby COUNTA


"Joeredmm" skrev:

I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Countif

If you mean that the COUNTIF part returns 6 then maybe you should check the
zero cells, if they are part of another formula you might have the cells
formatted as currency with 2 decimals and if your formula returns

0.0000001

it will be included in COUNTIF while the cell (thanks to the formatting)
will display 0.00


--
Regards,

Peo Sjoblom


"Joeredmm" wrote in message
...
I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Countif

The cells are percentages positive and negative of production values from a
mine plant. Five of the cells have data and the sith has a 0 that is derived
from this formula in each cell

=IF(G7=0,"0",(G7-G6)/G6)

if there is no data from the other worksheets the cell returns a zero value,
otherwise the value of the month will be returned.

Since there are five cells that are not equal to 0 they should return true
values and be counted. The formula returns six so it appears to be counting
the sixth cell showing a zero value. All of the cells are formatted to
percentages.
--
What year did you say this was


"tim m" wrote:

I just did a test and the formula seemed to work to me, when you say the
formula returns 6, you are just talking about the countif part and not the
whole formula correct? Because if you had a 6 and all the rest as zeros the
result would be 6 no?

"Joeredmm" wrote:

I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Countif

I just changed the formatting of the cells from percentage to numbers and
multiply by 100 to bring back to a percentage value and the formula works now.

If anyone comes up with a fix where I can use the percentage formatting let
me know.
--
What year did you say this was


"Peo Sjoblom" wrote:

If you mean that the COUNTIF part returns 6 then maybe you should check the
zero cells, if they are part of another formula you might have the cells
formatted as currency with 2 decimals and if your formula returns

0.0000001

it will be included in COUNTIF while the cell (thanks to the formatting)
will display 0.00


--
Regards,

Peo Sjoblom


"Joeredmm" wrote in message
...
I have a formula in a worksheet that I use to calculate the number of cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,268
Default Countif

Change the formula to

=IF(G7=0,0,(G7-G6)/G6)

Don't use quotations for numbers, that formula produces a text zero


--
Regards,

Peo Sjoblom




"Joeredmm" wrote in message
...
The cells are percentages positive and negative of production values from
a
mine plant. Five of the cells have data and the sith has a 0 that is
derived
from this formula in each cell

=IF(G7=0,"0",(G7-G6)/G6)

if there is no data from the other worksheets the cell returns a zero
value,
otherwise the value of the month will be returned.

Since there are five cells that are not equal to 0 they should return true
values and be counted. The formula returns six so it appears to be
counting
the sixth cell showing a zero value. All of the cells are formatted to
percentages.
--
What year did you say this was


"tim m" wrote:

I just did a test and the formula seemed to work to me, when you say the
formula returns 6, you are just talking about the countif part and not
the
whole formula correct? Because if you had a 6 and all the rest as zeros
the
result would be 6 no?

"Joeredmm" wrote:

I have a formula in a worksheet that I use to calculate the number of
cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even
when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Countif

That worked perfectly. Thanks
--
What year did you say this was


"Peo Sjoblom" wrote:

Change the formula to

=IF(G7=0,0,(G7-G6)/G6)

Don't use quotations for numbers, that formula produces a text zero


--
Regards,

Peo Sjoblom




"Joeredmm" wrote in message
...
The cells are percentages positive and negative of production values from
a
mine plant. Five of the cells have data and the sith has a 0 that is
derived
from this formula in each cell

=IF(G7=0,"0",(G7-G6)/G6)

if there is no data from the other worksheets the cell returns a zero
value,
otherwise the value of the month will be returned.

Since there are five cells that are not equal to 0 they should return true
values and be counted. The formula returns six so it appears to be
counting
the sixth cell showing a zero value. All of the cells are formatted to
percentages.
--
What year did you say this was


"tim m" wrote:

I just did a test and the formula seemed to work to me, when you say the
formula returns 6, you are just talking about the countif part and not
the
whole formula correct? Because if you had a 6 and all the rest as zeros
the
result would be 6 no?

"Joeredmm" wrote:

I have a formula in a worksheet that I use to calculate the number of
cells
to divide by. I use it to average percentages of the six cells which
represent monthly averages.

=SUM(H2:H7)/COUNTIF(H2:H7,"<0")

this is the formula. The problem is the formula still returns 6 even
when
some of the cells contain 0.

I am using Excel 2002
--
What year did you say this was




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
How do I use a countif function according to two other countif fu. Kirsty Excel Worksheet Functions 2 February 20th 06 11:44 AM
countif AJ Excel Worksheet Functions 2 January 2nd 06 10:41 PM
edit this =COUNTIF(A1:F16,"*1-2*")+COUNTIF(A1:F16,"*2-1*") sctroy Excel Discussion (Misc queries) 2 September 25th 05 04:13 AM
COUNTIF or not to COUNTIF on a range in another sheet Ellie Excel Worksheet Functions 4 September 15th 05 10:06 PM
COUNTIF in one colum then COUNTIF in another...??? JonnieP Excel Worksheet Functions 3 February 22nd 05 02:55 PM


All times are GMT +1. The time now is 02:28 AM.

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"