May 20, 2022

WEEKDAY Formula in Excel

WEEKDAY formula returns a number based on the day of the week

DOWNLOAD File and Live Example here –

Subscribe to this YouTube channel to get updates on Excel Tips and Excel Tutorials videos –

This YouTube channel is managed by Sumit Bansal (who also runs the TrumpExcel website). This channel is meant for people who want to learn Excel. It covers a lot of Excel basics and advanced Excel topics such as Excel Formulas, Functions, Pivot Table, Shortcuts, Excel VBA, Macros, Excel Dashboards, Excel Charts, Conditional Formatting, Power Query, etc. Please subscribe to this channel to be the first to know when new Excel tutorials come out.

You can find a lot of useful Excel resources on the following site:

#Excel #ExcelTips #ExcelTutorial


Xem thêm bài viết:

4 thoughts on “WEEKDAY Formula in Excel

  1. I have created this function to get first date of week as Thursday in ms access form and reports, but this function return first day of week in las month, but I need it will return only current month dates, if current week first day is in last month then retrun first day of week as 1st date of week in current month.

    ‘current output

    ‘when 1-10-2018 is selected from date picker it returns 27-09-2018, which is first date of week in last month but I need it will return 1st of month which is selected in textbox.

    Function GetFirstofWeek(dtDate As Date)

    'GetFirstofWeek = DateAdd("d", dtDate, -(Weekday(dtDate)) + 1)

    ' Excel formula for this function which is perfect and may be converted to function as required ‘=MAX(B2-WEEKDAY(B2,14)+1, EOMONTH(B2, -1)+1)

    GetFirstofWeek = DateAdd("d", dtDate, -(Weekday(dtDate, vbThursday) – 1))

    End Function

    'For last day of week

    Function GetLastofWeek(dtDate) as date

    '=MIN(B2+(7-WEEKDAY(B2,14)), EOMONTH(B2, 0))

    GetLastofWeek = DateAdd("d", dtDate, (7 – (Weekday(dtDate, vbWednesday)) + 1))

    End Function

    In this function last date of week must be in current month, if month end on first date of then week will be closed and last date of week will be 1st date of week or days remaining in current week.

Leave a Reply

Your email address will not be published. Required fields are marked *