PC Review


Reply
Thread Tools Rate Thread

How to count days in excel

 
 
firemedic1203
Guest
Posts: n/a
 
      25th Nov 2009
I am trying to use countif to count the number of times within a month that
my fire department has a call, meeting, truck check. I have the dates in
mm/dd/yy format. I figure that all I would have to do is use =COUNTIF
(A1:A25, 11/*/09) and it would work. But that is not the case. when I add
more calls/meetings/truck checks it does not add the new one to the total.
And yes I did change A25 to A26 so that it new to look there also. But the
total won't change. What am I doing wrong?
 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      25th Nov 2009
One way...

=SUMPRODUCT(--(MONTH(A1:A25)=n))

Where n = the month number from 1 to 12.

Note that empty cells will evaluate as month number 1 (Jan). To account for
that:

=SUMPRODUCT(--(A1:A25<>""),--(MONTH(A1:A25)=n))

--
Biff
Microsoft Excel MVP


"firemedic1203" <(E-Mail Removed)> wrote in message
news:2D70097B-4E4D-4773-B75D-(E-Mail Removed)...
>I am trying to use countif to count the number of times within a month that
> my fire department has a call, meeting, truck check. I have the dates in
> mm/dd/yy format. I figure that all I would have to do is use =COUNTIF
> (A1:A25, 11/*/09) and it would work. But that is not the case. when I
> add
> more calls/meetings/truck checks it does not add the new one to the total.
> And yes I did change A25 to A26 so that it new to look there also. But
> the
> total won't change. What am I doing wrong?



 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      25th Nov 2009
And if you really wanted to count the number of items in November of 2009:

=sumproduct(--(text(a1:a10,"yyyymm")="200911"))

Adjust the ranges to match--but you can't use whole columns (except in xl2007+).

=sumproduct() likes to work with numbers. The -- stuff changes trues and falses
to 1's and 0's.

Bob Phillips explains =sumproduct() in much more detail here:
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

And J.E. McGimpsey has some notes at:
http://mcgimpsey.com/excel/formulae/doubleneg.html

=========
You could also count the dates larger than Oct 31, 2009 and subtract the dates
larger or equal to Dec 1, 2009.

=countif(a:a,">"&date(2009,10,31)) - countif(a:a,">="&date(2009,12,1))


firemedic1203 wrote:
>
> I am trying to use countif to count the number of times within a month that
> my fire department has a call, meeting, truck check. I have the dates in
> mm/dd/yy format. I figure that all I would have to do is use =COUNTIF
> (A1:A25, 11/*/09) and it would work. But that is not the case. when I add
> more calls/meetings/truck checks it does not add the new one to the total.
> And yes I did change A25 to A26 so that it new to look there also. But the
> total won't change. What am I doing wrong?


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003: Count total days elapsed watermt Microsoft Excel Worksheet Functions 12 16th Jun 2009 08:12 PM
can I have excel count occurrences for 10 people in 7 days =?Utf-8?B?Z3JlYm5ldA==?= Microsoft Excel Worksheet Functions 6 16th Apr 2007 02:08 PM
How can I count amount of Days I worked per year on Excel ? =?Utf-8?B?QUEgT24gV2luZG93cw==?= Microsoft Excel Worksheet Functions 2 27th Sep 2006 07:01 PM
FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES =?Utf-8?B?UmhvbmRhMQ==?= Microsoft Excel Worksheet Functions 4 31st Jan 2006 12:13 AM
Count Days if they exist - Excel XP TAJ Simmons Microsoft Excel Worksheet Functions 1 20th Jan 2004 07:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:13 AM.