ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting problem again! (https://www.excelbanter.com/excel-worksheet-functions/5534-counting-problem-again.html)

Connie Martin

Counting problem again!
 
Hopefully, I can make this simple!

In H9:H400 and J9:J500 I have dates, manually inputted. In K9, I have this
formula: =IF(SUM(H9-J9=0),"-",SUM(H9-J9)), which formula carries down, of
course to K500, calculating the number of days difference between the two
dates. Column K is formatting "Accounting", so when the two manually input
dates are the same and there is no difference in days, then it enters a
simple dash. That all works fine. Now, the question: In I4 I want to put a
formula that counts all the ones that have no difference. I want it to start
with that if there's nothing to put nothing, otherwise count the ones that
have no difference. I tried this:
=IF(COUNT(K8:K500)=0,"",COUNT(K8:K500,"0")) but it doesn't work. I replaced
the "0" with "-", but still it yields nothing. I will have several down the
spreadsheet that will have no difference in dates. I want it to keep a
running total of them. How?

Connie Martin

In the formula K8:K500, I meant to type K9:K500, not that it makes any
difference in the worksheet I'm working with, but just for clarification.
Connie


"Connie Martin" wrote:

Hopefully, I can make this simple!

In H9:H400 and J9:J500 I have dates, manually inputted. In K9, I have this
formula: =IF(SUM(H9-J9=0),"-",SUM(H9-J9)), which formula carries down, of
course to K500, calculating the number of days difference between the two
dates. Column K is formatting "Accounting", so when the two manually input
dates are the same and there is no difference in days, then it enters a
simple dash. That all works fine. Now, the question: In I4 I want to put a
formula that counts all the ones that have no difference. I want it to start
with that if there's nothing to put nothing, otherwise count the ones that
have no difference. I tried this:
=IF(COUNT(K8:K500)=0,"",COUNT(K8:K500,"0")) but it doesn't work. I replaced
the "0" with "-", but still it yields nothing. I will have several down the
spreadsheet that will have no difference in dates. I want it to keep a
running total of them. How?


mzehr

Hi Connie,
In looking at your formula, it is inserting either a text "-" or a value,
depending on how the formula evaluates. You might consider changing the "-"
to 0, and since your column is formatted as accounting it will show up as "-".
The following formula will count every cell in column K that does not equal 0:
=COUNTIF(K9:K500,"<0")
If you want to count each cell that equals 0 use:
=COUNTIF(K9:K500,"=0") or more simply =COUNTIF(K9:K500,0)
Should you decide to keep the text part of your equation ("-") then use:
=COUNTIF(K9:K500,"-") to count how many cells meet that condition
and to count how many don't use:
=COUNTIF(K9:K500,"<-")
HTH

"Connie Martin" wrote:

Hopefully, I can make this simple!

In H9:H400 and J9:J500 I have dates, manually inputted. In K9, I have this
formula: =IF(SUM(H9-J9=0),"-",SUM(H9-J9)), which formula carries down, of
course to K500, calculating the number of days difference between the two
dates. Column K is formatting "Accounting", so when the two manually input
dates are the same and there is no difference in days, then it enters a
simple dash. That all works fine. Now, the question: In I4 I want to put a
formula that counts all the ones that have no difference. I want it to start
with that if there's nothing to put nothing, otherwise count the ones that
have no difference. I tried this:
=IF(COUNT(K8:K500)=0,"",COUNT(K8:K500,"0")) but it doesn't work. I replaced
the "0" with "-", but still it yields nothing. I will have several down the
spreadsheet that will have no difference in dates. I want it to keep a
running total of them. How?



All times are GMT +1. The time now is 07:31 AM.

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