Solved

Calculate number of weeks in a month in MS Excel 2013

Posted on 2016-09-11
12
173 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 
LVL 19

Expert Comment

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

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

Technology Partners: 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!

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

734 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