+ Reply to Thread
Results 1 to 7 of 7

Find monday preceeding given-date unless date is a monday

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,580

    Find monday preceeding given-date unless date is a monday

    I have a date and based on this date i want to find the preceeding monday for this date. However, if the date in question is a monday then leave as is.

    Examples below:

    Example1:
    Date:11/6/2012
    Return date: 11/5/2012



    Example2:
    Date:11/5/2012
    Return date: 11/5/2012


    Example3:
    Date:11/4/2012
    Return date: 10/29/2012
    Last edited by welchs101; 11-07-2012 at 01:22 PM.

  2. #2
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Find monday preceeding given-date unless date is a monday

    Assuming your date is in cell A1 -

    Please Login or Register  to view this content.
    Hope that helps

    Dave H
    - Mark your post [SOLVED] if it has been answered satisfactorily, by editing your original post using advanced mode.
    - Thank those that provided useful help, its nice and its very well appreciated...use the star on the lower left of the post

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,580

    Re: Find monday preceeding given-date unless date is a monday

    that seems to work exactly as i wanted.......thanks!!!!!!!!!!

  4. #4
    Forum Contributor Dave H9's Avatar
    Join Date
    03-10-2011
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    418

    Re: Find monday preceeding given-date unless date is a monday

    Glad to help,

    If you are satisfied with the solution please mark your thread as solved.

    Many thanks

    Dave H

  5. #5
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676

    Re: Find monday preceeding given-date unless date is a monday

    You can also get the same result with this formula

    =A1-WEEKDAY(A1,3)
    Audere est facere

  6. #6
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,580

    Re: Find monday preceeding given-date unless date is a monday

    thanks...........

    if i wanted to do the same thing inside VBA.........what would i have to do?

    I tried just using the formula provided and it did not seem to work.

    any ideas?

  7. #7
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,580

    Re: Find monday preceeding given-date unless date is a monday

    here is what i found ..used your suggestion along with dateadd function

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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