ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   countif() (https://www.excelbanter.com/excel-discussion-misc-queries/184825-countif.html)

Mike

countif()
 
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,

Bob Phillips

countif()
 
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)

"Mike" wrote in message
...
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,




Brad Vogt

countif()
 
=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.

"Mike" wrote:

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,


Bob Phillips

countif()
 
But only in XL2007.

--
HTH

Bob

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

"Brad Vogt" wrote in message
...
=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.

"Mike" wrote:

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,





All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com