+ Reply to Thread
Results 1 to 4 of 4

Roundingd ate to nearest Monday

  1. #1
    Registered User
    Join Date
    11-16-2011
    Location
    Reading, England
    MS-Off Ver
    Excel 2010
    Posts
    55

    Roundingd ate to nearest Monday

    I'm trying to round a date that an animal calves to the nearest Monday. Therefore in say cell A2 I will have the calving date and I want cell B2 to show the nearest Monday to that date. It may be the previous Monday if animal calves on a Tuesday, Wednesday of Thursday. Or the following Monday if animal calves on a Friday, Saturday or Sunday. If animal calves on a Monday then that date will be the same in B2. Hope that makes sense and any help would be appreciated.

  2. #2
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Excel 2007 & 2003
    Posts
    2,527

    Re: Roundingd ate to nearest Monday

    Suppose your date in "A2"
    formula in "B2"
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Both format as : [$-F800]dddd, mmmm dd, yyyy


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,571

    Re: Roundingd ate to nearest Monday

    There may be more elegant ways, but this will work with the calving date in A1:

    =IF(WEEKDAY(A1)=2,A1,IF(AND(WEEKDAY(A1)>1,WEEKDAY(A1)<6),A1-WEEKDAY(A1)+2,A1+(7-WEEKDAY(A1))))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    3,710

    Re: Roundingd ate to nearest Monday

    Or:

    =WORKDAY.INTL(A2-4,1,"0111111")

+ 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