countif()

M

Mike

Hi everyone, I'm trying to use the countif() to count if (naturually) a date
falls into a certain range. But when I put in wild cards (to account for
different time stamps) it doesn't count... I don't get it?

Cheers,
 
B

Bob Phillips

Because a date is just a number, and what you see is not what is held -
today's date is 29561 for instance.

You need to be more obtuse

test for Jan 2008

=SUMPRODUCT(--(MONTH(A2:A200)=1),--(YEAR(A2:A200)=2008))

test between 15th Jan and 15th Feb

=SUMPRODUCT(--(A2:A200>=--"2008-01-15")),--(A2:A200<--"2008-02-15"))

and so on

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Brad Vogt

=COUNTIFS(B8:B19,">=4/1/2008",B8:B19,"<=4/18/2008")

Countifs will give you the opportunity to set more than 1 criteria. In the
example above, the range of cells with dates is B8:B19 and the result will be
the total number of dates that meet the 2 criteria. The equal sign is only
to say greater than OR equal to.

The date format is month/date/year in the example also.
 
B

Bob Phillips

But only in XL2007.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
Top