I have a column which contains dates, I want to use the countif function to count the dates in a certain month. I can’t seem to get it working right. Can somebody suggest something
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Countif for dates between (xp)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Countif for dates between (xp)
- This topic has 3 replies, 4 voices, and was last updated 22 years, 10 months ago.
Viewing 2 reply threadsAuthorReplies-
H. Legare Coleman
AskWoody PlusJuly 9, 2002 at 2:55 pm #599986If the dates are in A1:A25, then the following array formula (hold down Shift+ Ctrl when you enter it) will count the number that are in January:
=SUM((MONTH(A1:A25)=1)*(A1:A25""))
To count February, change the “=1” to “=2”, or change the “=1” to “=” and a cell reference where you will enter the month number.
-
WSdcardno
AskWoody LoungerJuly 9, 2002 at 3:08 pm #600007I can’t help if you are committed to using “countif” – but if you are willing to use an array function, this will work:
Assuming your column of dates is in column A, extending from A2 to A78, and you want to be able to count the number that occur in May, June, November, etc – place a number from 1-12, representing the month (January – December) in cell A80. In cell B80, enter the formula:
=SUM(IF(MONTH(A$2:A$78) = A80,1,0))
This will be an array formula, and must be entered by hitting ctrl-shift-enter. Excel will insert braces around the formula to indicate that it is an array formula. If you need to see the count for more than one month at a time, drag to copy the formula down the B column, and then put in the months you need. If required, you can have twelve copies of the formula and show the count for all twelve months at once. The referenced range for the formula (A2:A78) can be changed either by editing the formula bar or by dragging an outline – just remember to enter the formula by ctrl-shift-enter.
An alternate formula woudl be:
=SUM((MONTH(A$2:A$78) = A81)*1)
This might evaluate faster, but I doubt that the difference would be noticeable
If you are dealing with more than one year you can edit the criteria to use an “AND” function to test for the value in the range to be more than a particular starting date and less than an ending date, as well – unless you want to aggregate May 02 with May 01
-
WSJohnBF
AskWoody Lounger
Viewing 2 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Windows 11 Insider Preview build 26200.5603 released to DEV
by
joep517
22 minutes ago -
Windows 11 Insider Preview build 26120.4151 (24H2) released to BETA
by
joep517
24 minutes ago -
Fixing Windows 24H2 failed KB5058411 install
by
Alex5723
3 hours, 34 minutes ago -
Out of band for Windows 10
by
Susan Bradley
5 hours, 7 minutes ago -
Giving UniGetUi a test run.
by
RetiredGeek
12 hours, 4 minutes ago -
Windows 11 Insider Preview Build 26100.4188 (24H2) released to Release Preview
by
joep517
19 hours, 41 minutes ago -
Microsoft is now putting quantum encryption in Windows builds
by
Alex5723
17 hours, 40 minutes ago -
Auto Time Zone Adjustment
by
wadeer
1 day ago -
To download Win 11 Pro 23H2 ISO.
by
Eddieloh
21 hours, 51 minutes ago -
Manage your browsing experience with Edge
by
Mary Branscombe
2 hours, 26 minutes ago -
Fewer vulnerabilities, larger updates
by
Susan Bradley
13 hours, 22 minutes ago -
Hobbies — There’s free software for that!
by
Deanna McElveen
17 hours, 39 minutes ago -
Apps included with macOS
by
Will Fastie
17 hours, 17 minutes ago -
Xfinity home internet
by
MrJimPhelps
17 hours, 12 minutes ago -
Convert PowerPoint presentation to Impress
by
RetiredGeek
17 hours, 10 minutes ago -
Debian 12.11 released
by
Alex5723
1 day, 21 hours ago -
Microsoft: Troubleshoot problems updating Windows
by
Alex5723
2 days, 1 hour ago -
Woman Files for Divorce After ChatGPT “Reads” Husband’s Coffee Cup
by
Alex5723
1 day, 4 hours ago -
Moving fwd, Win 11 Pro,, which is best? Lenovo refurb
by
Deo
20 hours, 51 minutes ago -
DBOS Advanced Network Analysis
by
Kathy Stevens
2 days, 17 hours ago -
Microsoft Edge Launching Automatically?
by
healeyinpa
2 days, 8 hours ago -
Google Chrome to block admin-level browser launches for better security
by
Alex5723
6 hours, 3 minutes ago -
iPhone SE2 Stolen Device Protection
by
Rick Corbett
2 days, 12 hours ago -
Some advice for managing my wireless internet gateway
by
LHiggins
1 day, 20 hours ago -
NO POWER IN KEYBOARD OR MOUSE
by
HE48AEEXX77WEN4Edbtm
22 hours, 22 minutes ago -
A CVE-MITRE-CISA-CNA Extravaganza
by
Nibbled To Death By Ducks
3 days, 6 hours ago -
Sometimes I wonder about these bots
by
Susan Bradley
18 hours, 11 minutes ago -
Does windows update component store “self heal”?
by
Mike Cross
2 days, 16 hours ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
3 days, 20 hours ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
2 days, 3 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.