ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   ... Count, <<< Positive Values minus Negative Values >>> ... (https://www.excelbanter.com/excel-worksheet-functions/44404-count-%3C%3C%3C-positive-values-minus-negative-values-%3E%3E%3E.html)

Dr. Darrell

... Count, <<< Positive Values minus Negative Values >>> ...
 
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

Paul Sheppard


Dr. Darrell Wrote:
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


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=465879


Robbo

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


"Dr. Darrell" wrote:

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


CLR

=COUNTIF(A:A,"0")

or, if you prefer,

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

Vaya con DIos,
Chuck, CABGx3





"Dr. Darrell" wrote:

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


Ron de Bruin

Hi Dr. Darrell

Try this
=COUNTIF(A1:A20,"0")

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Dr. Darrell" wrote in message ...
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





All times are GMT +1. The time now is 09:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com