Solved

Calculate number of weeks in a month in MS Excel 2013

Posted on 2016-09-11
12
118 Views
Last Modified: 2016-09-12
How to calculate number of weeks in a month in Excel 2013? Below is the Excel table that I am using.
Table
0
Comment
Question by:cbinayak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
12 Comments
 
LVL 19

Expert Comment

by:Roy_Cox
ID: 41793364
Assuming the 1st of the month is entered in A1 as a date then

=DAY(EOMONTH(A1,0))/7
0
 
LVL 19

Accepted Solution

by:
Roy_Cox earned 500 total points
ID: 41793366
This will give you exact weeks

=INT(DAY(EOMONTH(A1,0))/7) &" weeks"

This will give weeks & days

=INT(DAY(EOMONTH(A1,0))/7)&" weeks and "&DAY(EOMONTH(A1,0))-INT(DAY(EOMONTH(A1,0))/7)*7 &" days"
0
 

Author Comment

by:cbinayak
ID: 41793372
While using the below formula I am getting error.

=INT(DAY(EOMONTH(B2,0))/7) &" weeks"

However, =INT(DAY(EOMONTH(B2,0))/7) is working fine but not getting any result for other months.
Excel Formula
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:Roy_Cox
ID: 41793375
This works for me
WEEKS-IN-MONTH.xlsx
0
 
LVL 69

Expert Comment

by:Qlemo
ID: 41793378
01-10-206 isn't a date ...
1
 
LVL 19

Expert Comment

by:Roy_Cox
ID: 41793380
Well spotted. I didn't use the OP's table.
0
 

Author Closing Comment

by:cbinayak
ID: 41793410
Thanks. It's working now.
0
 
LVL 19

Expert Comment

by:Roy_Cox
ID: 41793730
Pleased to help
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41794172
What was the point of the question?

All months have 4 weeks. Different months then have zero, two or three more days; 28 for Feb, 30 for April, June, September and November; all the rest have 31.

However, if you are counting only WHOLE weeks starting on a particular day, there could be differences.

For example, for the items listed in your table, assuming whole weeks starting on Sunday:

First Sunday in September was 4 September, last Saturday (to give whole weeks) in September is 24 September. 4 Sept to 24 Sept is 3 whole weeks.
October - First Sunday 02 Oct, Last Saturday 29 Oct, gives 4 weeks
November - First Sunday 06 Nov, Last Saturday 26 Nov, gives 3 weeks
December - First Sunday 04 Dec, Last Saturday 31 Dec, gives 4 weeks.

Thanks
Rob H
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41794197
This formula will give number of whole weeks:

=(IF(WEEKDAY(EOMONTH(N3,0))=7,EOMONTH(N3,0),FLOOR(EOMONTH(N3,0),7))-IF(WEEKDAY(N3,1)=1,N3,CEILING(N3,7)+1)+1)/7

Date in cell N3. The bold 7 assumes week ending Saturday, the bold 1 assumes week starting Sunday.
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41794243
Looks like you don't need the WEEKDAY check for the last day of the month:

=(FLOOR(EOMONTH(N3,0),7)-IF(WEEKDAY(N3,1)=1,N3,CEILING(N3,7)+1)+1)/7
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 41794278
Prior formula assumes weeks beginning Sunday.

This assumes week beginning Monday, ie whole working weeks:

=(IF(WEEKDAY(EOMONTH(N3,0))=1,EOMONTH(N3,0),FLOOR(EOMONTH(N3,0),7)+1)-IF(WEEKDAY(N3,1)=2,N3,CEILING(N3,7)+2)+1)/7

Thanks
Rob H
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question