dcount question

  • Thread starter Thread starter chadwick
  • Start date Start date
C

chadwick

Hi all - a simple question (I think).

I'm trying to use the DCount function to count all records for which
the "Completion Date" field is NOT "TBD." I can easily count all
records whose dates are "TBD," or any specific date, eg "9/15/2002," by
simply entering that info in the criteria field that I'm referencing.
Can anyone tell me how to enter a NOT criterion?

As always, all help is greatly appreciated. Thanks.
 
Just use <>
For example, in G1 put Completion Date and in G2 put <>TBD
Then in your DCOUNT formula, the criteria is simply G1:G2
 
Dave,

Oddly, "<>tbd" works too, though yours seems more sensible.

Countif has a strange set of rules, and also doesn't follow the ASCII code
value strictly when doing < or > operations. COUNTIF(a1:a10, tbd) should
fail with a name error, but doesn't. Doesn't work either.
 
"<>"&"tbd" will evaluate to "<>tbd", but I like

=countif(a1:a10,"<>"&"tbd")
so that if you want to point at a cell that contained TBD, it looks like it
would be easier to fix:

=countif(a1:a10,"<>"&a1)
 
Back
Top