Is there a way to calculate the number of weeks in a month based on a date cell?
E.g. 8/31/05 = 5 weeks or 4 full weeks and 1 partial week
![]() |
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 |
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » Calc # Weeks Based on Date Cell (2003)
For what it is worth, a month can not have five weeks. 7 times 5 is 35, and no month has more than 31 days. A month always has four full weeks, and if it is not February in a non leap year, part of a week. A month can have five of whatever day the 1st, 2nd, or 3rd falls on. So, what is your definition of a month with five weeks?
If you are counting partial weeks plus full weeks, then
Nov 97 has 2 partial weeks + 4 full weeks = 6
Dec 97 has 2 partial weeks + 3 full weeks = 5
Jan 98 has 1 partial week + 4 full weeks = 5
Feb 98 has just 4 full weeks = 4
Mar 98 has 1 partial week + 4 full weeks = 5
Apr 98 has 2 partial weeks + 3 full weeks = 5
May 98 has 2 partial weeks + 4 full weeks = 6
Assuming the date in A1, a formula for this would be:
=IF(AND(EOMONTH(A1,0)-EOMONTH(A1,-1)=28,WEEKDAY(EOMONTH(A1,0))=7),4,IF(AND(EOMONTH(A1,0)-EOMONTH(A1,-1)=30,WEEKDAY(EOMONTH(A1,0))=1),6,IF(AND(EOMONTH(A1,0)-EOMONTH(A1,-1)=31,WEEKDAY(EOMONTH(A1,0))<3),6,5)))
which reads if there are 28 days in the month and it begins on Monday, then there are 4 weeks; otherwise
if there are 30 days in the month and it begins on Saturday, then there are 6 weeks; otherwise
if there are 31 days in the month and it begins on Friday or Saturday, then there are 6 weeks; otherwise
there are 5 weeks!
That wins an ugly formula prize! –Sam
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.
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.
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.
Notifications