+ Reply to Thread
Results 1 to 6 of 6

Week of the month (1 to 5)

  1. #1
    Registered User
    Join Date
    04-28-2017
    Location
    Vilnius, Lithuania
    MS-Off Ver
    2013
    Posts
    2

    Week of the month (1 to 5)

    Hi,

    I am not able to find a solution to the following problem:
    I need a formula to define which week of the month the date is, from 1st to 5th. With the assumption that if there is a week where there are more than 4 days from the first days of a month - it is a 1st week (like June 2017 for example, 1st June starts on Thursday, so it should be counted as 1st week for June, and not counted for May 2017 as it includes less than 3 May days). Googled a lot, haven't found suitable solution... Hope you can help guys!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Week of the month (1 to 5)

    "where there are more than 4 days from the first days of a month"
    There are ALWAYS more than 4 days from the first day of a month, can you be more specific?

    Attach a sample spreadsheet with expected results, remove any sensitive data, create a mockup example if necessary.
    Use the Go Advanced option at the bottom of the page then scroll down to Manage Attachments as the "paperclip" method does not work on this forum.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    04-28-2017
    Location
    Vilnius, Lithuania
    MS-Off Ver
    2013
    Posts
    2

    Re: Week of the month (1 to 5)

    "where there are more than 4 days from the first days of a month" - for example 29th-31st of May 2017 are Monday - Wednesday, 1st-4th June - Thursday-Friday, so June has 4 days that week and therefore it is going to be counted as 1st week of June. If there were 4 days for May - Monday-Thursday or more - it would be May 5th week.
    Please see example attached. I need numbers in column E to be represented by formulas
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,728

    Re: Week of the month (1 to 5)

    You seem to be defining a week as Monday to Sunday, and if the first of a month begins on a Monday to Thursday (inclusive) then that should be counted as week 1 for the month. You can test for that condition like this:

    =IF(WEEKDAY(first_of_month,2)<5, ...

    you can get the first_of_month from a date (in B3) like this:

    EOMONTH(B3,-1)+1

    or even:

    DATE(YEAR(B3),MONTH(B3),1)

    Hope this helps.

    Pete

  5. #5
    Forum Contributor
    Join Date
    09-11-2008
    Location
    uk
    MS-Off Ver
    2010; 2016
    Posts
    390

    Re: Week of the month (1 to 5)

    Hi,

    Please see attached which I think solves your problem.

    Change cell A2 only to see results in Col F.

    Hope this helps

    Skyping
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    05-30-2015
    Location
    Dubai
    MS-Off Ver
    Excel 2016 Mac & PC & 365
    Posts
    633

    Re: Week of the month (1 to 5)

    =weeknum(b3,2)-weeknum(eomonth(b3,-1)+1)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Getting the Week number based on the week of the month
    By Meggo12 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2016, 02:22 PM
  2. Formula to give week number of a month according to date of the month
    By tukae in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-08-2016, 11:14 PM
  3. [SOLVED] Calculate Week Range from Week Number, Month and Year?
    By A108A108 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-07-2016, 03:11 PM
  4. Replies: 10
    Last Post: 03-15-2016, 05:16 PM
  5. [SOLVED] Showing Fridays of each month in a 4 week month and a five week month
    By david_j_p in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-09-2013, 06:27 AM
  6. Replies: 10
    Last Post: 01-22-2012, 10:05 AM
  7. [SOLVED] Excel month dropdown list to generate day of week and date for selected month
    By aaaaaaaa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-17-2010, 02:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1