View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default COUNTIF / AND functions

It works fine for me using time values. did you format the cell as number
or general instead of time. are your values really just time values.

This is the general solution and works in all cases (times, dates, numbers,
text - any place a single countif would produce an accurate count if there
is only one criteria) when properly written.

Countif/sumif don't work with AND/OR. Maybe you would feel more comfortable
with the slower sumproduct approach offered by Sebastion.

--
Regards,
Tom Ogilvy

"brianwakin" wrote in message
...
I see what you are trying to do here, but it doesn't work for my

application
(the 9AM and 10AM was just an example). Is there any way to use AND/OR

with
COUNTIF? Thanks.
--
Brian


"Tom Ogilvy" wrote:

=COUNTIF(B4:B27,"=9:00 am")-Countif(B4:B27,"10:00 am")

--
Regards,
Tom Ogilvy


"brianwakin" wrote in message
...
How do I use the COUNTIF and the AND functions together? I tried

using
the
following formula and got an error:

=COUNTIF(and((B4:B27,"=9 am"),(B4:B27,"<=10 am")))
--
Thanks.

Brian