... Count, <<< Positive Values minus Negative Values >>> ...

G

Guest

I have a column which contains 20 cells with 4 negative values and 12
positive values.

I want to do a count, but I only want a count the positive valued cells
minus the negative valued cells. so the result of the count in this example
would be 12-4=8.

How do I write my function?

Darrell
 
P

Paul Sheppard

Dr. Darrell said:
I have a column which contains 20 cells with 4 negative values and 12
positive values.

I want to do a count, but I only want a count the positive valued
cells
minus the negative valued cells. so the result of the count in this
example
would be 12-4=8.

How do I write my function?

Darrell

Hi Darrell

Try this > =SUM(COUNTIF(A1:A20,">0")-COUNTIF(A1:A20,"<0"))

This will ignore 0's, blanks and text
 
G

Guest

You can try this:

=SUM((COUNTIF(A1:A20,">0")-(COUNTIF(A1:A20,"<0"))))

This counts the positive values, and the negative values, and subtracts them.

Hope this helps
 
G

Guest

=COUNTIF(A:A,">0")

or, if you prefer,

=COUNT(A:A)-COUNTIF(A:A,"<=0")

Vaya con DIos,
Chuck, CABGx3
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top