Using Sumif/Countif for a range

S

Stefan Keydel

Greetings,

I'm hoping to be able to sumif and/or countif to count the number of
occurrences of a specific date and hour. For example, if I had a column
with the following values:

2/1/04 12:58
2/1/04 14:22
2/1/04 15:23
2/1/04 15:25
2/1/04 16:22

and I wanted to count the number of occurences between 2/1/04 15:00 and
2/1/04 16:00, how could I do this?


Thanks,

Stefan
 
J

JE McGimpsey

Stefan Keydel said:
Greetings,

I'm hoping to be able to sumif and/or countif to count the number of
occurrences of a specific date and hour. For example, if I had a column
with the following values:

2/1/04 12:58
2/1/04 14:22
2/1/04 15:23
2/1/04 15:25
2/1/04 16:22

and I wanted to count the number of occurences between 2/1/04 15:00 and
2/1/04 16:00, how could I do this?

Between is such an ambiguous word...

Here's one way:

To include 15:00, but not 16:00:

=COUNTIF(A:A,">=02/01/2004 15:00") - COUNTIF(A:A,">=02/01/2004 16:00")

To include 16:00, but not 15:00:

=COUNTIF(A:A,">02/01/2004 15:00") - COUNTIF(A:A,">02/01/2004 16:00")

To include both 15:00 and 16:00:

=COUNTIF(A:A,">=02/01/2004 15:00") - COUNTIF(A:A,">02/01/2004 16:00")

To include neither 15:00 nor 16:00:

=COUNTIF(A:A,">02/01/2004 15:00") - COUNTIF(A:A,">=02/01/2004 16:00")
 
S

Stefan Keydel

JE said:
Between is such an ambiguous word...

Here's one way:

To include 15:00, but not 16:00:

=COUNTIF(A:A,">=02/01/2004 15:00") - COUNTIF(A:A,">=02/01/2004 16:00")

To include 16:00, but not 15:00:

=COUNTIF(A:A,">02/01/2004 15:00") - COUNTIF(A:A,">02/01/2004 16:00")

To include both 15:00 and 16:00:

=COUNTIF(A:A,">=02/01/2004 15:00") - COUNTIF(A:A,">02/01/2004 16:00")

To include neither 15:00 nor 16:00:

=COUNTIF(A:A,">02/01/2004 15:00") - COUNTIF(A:A,">=02/01/2004 16:00")
Thanks! I'll give it a try.

Stefan
 

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

Top