How to find the start date of week from a given date?

前端 未结 2 1763
小鲜肉
小鲜肉 2021-01-19 00:40

I have a concern is that I want from a given date to retrieve the start date of the week for example: 15/04/2015 So the beginning of the week will: 13/04/2015 (for me the be

相关标签:
2条回答
  • 2021-01-19 01:13

    Try this Formula:-

    =A1-WEEKDAY(A1,2)+1
    

    Where A1 contains your Input Date.

    0 讨论(0)
  • 2021-01-19 01:31

    Try this :-)

    Dim FirstDayInWeek, LastDayInWeek  As Variant
    Dim dtmDate As Date
    dtmDate = "15/04/2015"
    

    The begin date of week:

    FirstDayInWeek = dtmDate - Weekday(dtmDate, vbUseSystem) + 1
    MsgBox FirstDayInWeek
    

    The end date of Week

    LastDayInWeek = dtmDate - Weekday(dtmDate, vbUseSystem) + 7
    MsgBox LastDayInWeek
    
    0 讨论(0)
提交回复
热议问题