+ Reply to Thread
Results 1 to 9 of 9

nth day of week

  1. #1
    Registered User
    Join Date
    03-25-2021
    Location
    Ipswich, England
    MS-Off Ver
    2016
    Posts
    2

    nth day of week

    Hi All, I have a need to calculate whether a date is the 3rd Thursday or 4th Tuesday etc.

    I already know that the 17/01/2022 is a Monday (for example), but I'd like to know whether its the 3rd Monday, 4th Monday etc. Does anyone know how to do that?

    Thanks

    Ray

  2. #2
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: nth day of week

    With date in A2

    PHP Code: 
    =ROUNDDOWN(DAY(A2)/7,0)+

    Kind regards
    Leo
    Attached Files Attached Files

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: nth day of week

    Minor correction to Leo's formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    03-25-2021
    Location
    Ipswich, England
    MS-Off Ver
    2016
    Posts
    2

    Re: nth day of week

    Hi Both, apologies if this is a duplicate, as I thought I had already posted - many thanks to you both for such a speedy reply.

    I must say I do not understand the subtleties of the minor correction, as when I copy both of the formula into my spreadsheet they both work.

    Many thanks again - really much appreciated .

    Ray

  5. #5
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: nth day of week

    I do not understand the subtleties of the minor correction
    me to

    kind regards
    Leo

  6. #6
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: nth day of week

    Check for June. That's funny, for whole 2021 only June shows difference.
    Last edited by KOKOSEK; 04-07-2021 at 05:48 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: nth day of week

    (1)=ROUNDDOWN(DAY(A2)/7,0)+1
    (2)=ROUNDDOWN((DAY(A2)-1)/7,0)+1

    In first 7 days of month, every weekdays must be counted 1, and count 2 from day 8
    (1) starts to count 2 from 7th day, 3 from 14th,... => wrong
    (2) starts to count 2 from 8th day, 3 from 15th,...=>correct.
    that why DAY(A2) minus 1.
    Quang PT

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: nth day of week

    Without the minus 1, the first week of each month only has 6 days which throws off the first day of each new week by one.
    i.e. Jan 2022 begins on a Saturday so the next Friday (7 Jan 2022) should still be week 1 but it calculates as Week 2.

  9. #9
    Forum Expert
    Join Date
    08-16-2015
    Location
    Antwerpen, Belgium
    MS-Off Ver
    2007-2016
    Posts
    2,380

    Re: nth day of week

    Yes i was wrong, i see now

    thanks for correction and explication

    Leo

+ 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. Replies: 5
    Last Post: 04-11-2017, 09:23 AM
  2. [SOLVED] Find where a specific week commencing date falls within a rolling10 week pattern
    By C J W in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-14-2017, 04:39 AM
  3. [SOLVED] Macro that displays all the weeks between Start Week and End Week (ends in next year)
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-31-2014, 05:38 AM
  4. [SOLVED] excel hlep to calculate the week no from dispatch to closed calls week wise
    By johnodys in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-05-2013, 04:53 AM
  5. Replies: 7
    Last Post: 05-02-2013, 06:48 AM
  6. How to: identify repeat offenders within a 3 week period (week per week basis)
    By Heloc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2012, 12:43 AM
  7. Replies: 11
    Last Post: 04-06-2011, 02:33 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