Count Cells that Contain Specific Date Range

TheKB

New Member
Joined
Feb 22, 2006
Messages
13
I have a spreadsheet with dates ranging throughout the year. I want to count all the cells that contain January dates, for example. How can I accompllish this?

Thanks in advance!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
If your data are in column A
Enter 01/01/2010 in B1 then 31/01/2010 in C1 an then in D1
=SUMPRODUCT(--(A1:A16>B1),--(A1:A16<C1)) (example)
 
Upvote 0
What version of Excel are you using? If you are using 2007 or newer you can filter for January and then it will tell you how many cells are filtered, otherwise you can probably use a formula like this in any case:

=sumproduct(--(month(A1:A1000)=1))

Hope that helps.
 
Upvote 0
Thank you - haven't tried the 1st suggestion yet (doing that next) yet the 2nd seemed promising until it returned all blank rows as January. I'm using Excel 2003.

Appreciate both of you!
 
Upvote 0
Blanks are considered as 0.
Believe it or not, Excel considers the number 0 to be the date
January 0 1900
I know it doesn't make sense, but it is what it is.
Basically because the number 1 is January 1st 1900.
Excel doesn't understand that dates existed in the 1800's..
So it makes 0 Jan 0 1900..


Anyway, that's the why...

You may be better off accounting for the year anyway..
Because dates in january of 2009 will be counted the same as january in 2010

Try

=SUMPRODUCT(--(TEXT(A1:A1000,"mmmyyyy")="Jan2010"))

Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,216,500
Messages
6,131,016
Members
449,615
Latest member
Nic0la

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top