Counting problem again!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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
 
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
 

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

Similar Threads

Formatting a Cell Reference with a Formula 6
Workdays 3
Calculating time 3
TIMECALC Formulas 2
if formula 3
Repeat formula with inserted row 3
IF AND problem 5
Sum select cells based on date range 2

Back
Top