Results 1 to 5 of 5

Thread: Weekday Error

  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Weekday Error

    Ads on and off.xlsx

    Can anybody please tell me why this formula give Wednesday instead of Friday

    thanks in advance

    Braddy60
    If you are a fool at forty, you will always be a fool

  2. #2
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,643
    Thanks
    115
    Thanked 652 Times in 594 Posts
    weekday(E4) returns 4 as 10/19/2016 is a Wednesday which is day 4 of the week. The fourth choice in your formula is Wednesday and therefore the value returned. Your did not specify the return type so it defaults to Sunday as day 1

    HTH,
    Maud

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Maudibe View Post
    weekday(E4) returns 4 as 10/19/2016 is a Wednesday which is day 4 of the week. The fourth choice in your formula is Wednesday and therefore the value returned. Your did not specify the return type so it defaults to Sunday as day 1

    HTH,
    Maud
    Hi thanks for your reply could you elaborate a bit on the meaning of return type please

    Thanks
    Braddy60
    If you are a fool at forty, you will always be a fool

  4. #4
    Gold Lounger Maudibe's Avatar
    Join Date
    Aug 2010
    Location
    Pa, USA
    Posts
    2,643
    Thanks
    115
    Thanked 652 Times in 594 Posts
    Braddy,

    The syntax for the weekday formula is: WEEKDAY(serial_number,[return_type])

    In your example your formula was =Weekday(E4). Your formula could have been WEEKDAY(E4,2). The return type of 2 would indicate that the return value starts with Monday whereas a 1 or omitted return type, the return value starts on a Sunday (see the table below)

    Return_type Optional. A number that determines the type of return value.
    Return_type Number returned
    1 or omitted= Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.
    2= Numbers 1 (Monday) through 7 (Sunday).
    3= Numbers 0 (Monday) through 6 (Sunday).
    11= Numbers 1 (Monday) through 7 (Sunday).
    12= Numbers 1 (Tuesday) through 7 (Monday).
    13= Numbers 1 (Wednesday) through 7 (Tuesday).
    14= Numbers 1 (Thursday) through 7 (Wednesday).
    15= Numbers 1 (Friday) through 7 (Thursday).
    16= Numbers 1 (Saturday) through 7 (Friday).
    17= Numbers 1 (Sunday) through 7 (Saturday).

    Example: E4=10/17/2016 is a Monday

    =Weekday(E4,1) or just Weekday(E4) returns a 2 because Monday is the second day starting from Sunday

    =Weekday(E4,2) returns a 1 because the return type of 2 specifies that Monday is the first day of the weekdays

    Essentially, it is setting the starting point and returning the number of weekdays from that point.

    HTH,
    Maud

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by Maudibe View Post
    Braddy,

    The syntax for the weekday formula is: WEEKDAY(serial_number,[return_type])

    In your example your formula was =Weekday(E4). Your formula could have been WEEKDAY(E4,2). The return type of 2 would indicate that the return value starts with Monday whereas a 1 or omitted return type, the return value starts on a Sunday (see the table below)

    Return_type Optional. A number that determines the type of return value.
    Return_type Number returned
    1 or omitted= Numbers 1 (Sunday) through 7 (Saturday). Behaves like previous versions of Microsoft Excel.
    2= Numbers 1 (Monday) through 7 (Sunday).
    3= Numbers 0 (Monday) through 6 (Sunday).
    11= Numbers 1 (Monday) through 7 (Sunday).
    12= Numbers 1 (Tuesday) through 7 (Monday).
    13= Numbers 1 (Wednesday) through 7 (Tuesday).
    14= Numbers 1 (Thursday) through 7 (Wednesday).
    15= Numbers 1 (Friday) through 7 (Thursday).
    16= Numbers 1 (Saturday) through 7 (Friday).
    17= Numbers 1 (Sunday) through 7 (Saturday).

    Example: E4=10/17/2016 is a Monday

    =Weekday(E4,1) or just Weekday(E4) returns a 2 because Monday is the second day starting from Sunday

    =Weekday(E4,2) returns a 1 because the return type of 2 specifies that Monday is the first day of the weekdays

    Essentially, it is setting the starting point and returning the number of weekdays from that point.

    HTH,
    Maud
    Thanks very much for your reply its much appreciated
    Braddy60
    If you are a fool at forty, you will always be a fool

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •