A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

CountIf on Date / Time



 
 
Thread Tools Display Modes
  #11  
Old May 11th, 2009, 10:39 PM posted to microsoft.public.excel.worksheet.functions
Thomas M.
external usenet poster
 
Posts: 130
Default CountIf on Date / Time

I used the first option and it that works perfectly.

In my particular situation I need to keep a counter for each month. So I
have the months listed in F1:Q1, I named that range, and then in F2:Q2 I
have the following modification of your formula:

=SUMPRODUCT(--(ISNUMBER(Incident_Dates)),--(MONTH(Incident_Dates)=MATCH(I1,Months_List,0)))

That gives me a formula that is the same for all 12 months (I don't have to
put =1, =2, =3, etc. at the end of each formula).

Thanks for the help.

--Tom

"T. Valko" wrote in message
...
Empty cells will evaluate as month 1 (January). So, if you're counting for
month 4 (April) the empty cells shouldn't make a difference. The only time
the empty cells will make a difference is if you're counting month 1.

To account for that just add a test that the cells contain a number or
that the cells are not blank.

=SUMPRODUCT(--(ISNUMBER(Incident_Dates)),--(MONTH(Incident_Dates)=4))

=SUMPRODUCT(--(Incident_Dates""),--(MONTH(Incident_Dates)=4))


--
Biff
Microsoft Excel MVP


"Thomas M." wrote in message
...
Excel 2007

=SUMPRODUCT(--(HOUR(A2:A10000)=0))


I have a similar need as the original poster, except that I need to count
up entries by month. I modified the above command as follows:

=SUMPRODUCT(--(MONTH(Incident_Dates)=4))

That works to count all the entries for April. However, my
Incident_Dates range is 100 rows, and most of those do not yet contain
data. If I use my version of your formula and the range does not contain
any dates for a given month, the formula returns 100 minus the number of
cells in the range that do contain data. How could the number of entries
for a given month be counted without the blank cells skewing the results?

--Tom





  #12  
Old May 11th, 2009, 11:10 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default CountIf on Date / Time

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Thomas M." wrote in message
...
I used the first option and it that works perfectly.

In my particular situation I need to keep a counter for each month. So I
have the months listed in F1:Q1, I named that range, and then in F2:Q2 I
have the following modification of your formula:

=SUMPRODUCT(--(ISNUMBER(Incident_Dates)),--(MONTH(Incident_Dates)=MATCH(I1,Months_List,0)))

That gives me a formula that is the same for all 12 months (I don't have
to put =1, =2, =3, etc. at the end of each formula).

Thanks for the help.

--Tom

"T. Valko" wrote in message
...
Empty cells will evaluate as month 1 (January). So, if you're counting
for month 4 (April) the empty cells shouldn't make a difference. The only
time the empty cells will make a difference is if you're counting month
1.

To account for that just add a test that the cells contain a number or
that the cells are not blank.

=SUMPRODUCT(--(ISNUMBER(Incident_Dates)),--(MONTH(Incident_Dates)=4))

=SUMPRODUCT(--(Incident_Dates""),--(MONTH(Incident_Dates)=4))


--
Biff
Microsoft Excel MVP


"Thomas M." wrote in message
...
Excel 2007

=SUMPRODUCT(--(HOUR(A2:A10000)=0))

I have a similar need as the original poster, except that I need to
count up entries by month. I modified the above command as follows:

=SUMPRODUCT(--(MONTH(Incident_Dates)=4))

That works to count all the entries for April. However, my
Incident_Dates range is 100 rows, and most of those do not yet contain
data. If I use my version of your formula and the range does not
contain any dates for a given month, the formula returns 100 minus the
number of cells in the range that do contain data. How could the number
of entries for a given month be counted without the blank cells skewing
the results?

--Tom







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.