How to Validate Dates in SharePoint to Choose WeekEnds?(Saturdays & Sundays)

Recently, while working with our client on the Project Management portal, I was assigned to validate the SharePoint date and time column so that weekends are selected instead of weekdays.

This can be achieved by using the WEEKDAY() function in SharePoint.

In this tutorial, I will explain the functionality and syntax of the SharePoint WEEKDAY() function with an example.

I will also cover how to validate dates in SharePoint to choose WeekEnds, such as Saturdays and Sundays.

WEEKDAY() Function in SharePoint

WEEKDAY(): The weekday() function returns the day of the week corresponding to the date. By default, integers represent days ranging from (1-> Sunday) to (7-> Saturday).

Syntax: WEEKDAY(serial_number, return_type)

Parameters:

  • Serial number: Input the sequential number, which represents the day of the date.
  • Return type: A number represents the type of return value.

The below shows the output returned from the WEEKDAY() function:

Return TypeNumber Returned
1 or NothingNumber returns 1 (Sunday) through 7 (Saturday)
2Number returns 1 (Monday) through 7 (Sunday)
3Number returns 0 (Monday) through 6 (Sunday)

Example:

WEEKDAY(“3/07/2025”) = Returns the output (6) -> Where six integers represents Friday [Day of the week starts from 1 (Sunday) follows 7 (Saturday)].

Important:

In this, dates are stored as a sequential numbers from the reference day. By default January 1, 2008 is a serial number 1. Sequential numbers can be calculated from this date.

Validate Dates in SharePoint to Choose WeekEnds [Using WEEKDAY()]

I have a SharePoint list with several columns, one of which is [Week Ending], a Date and time column.

I require setting the validation condition date column [Week Ending] so that users can only select weekends, like Saturday and Sunday, from the calendar when creating an item in the SharePoint list.

If the users select the weekday dates (Mon – Fri), the error message should display without saving the list items.

Column NameDataType
TitleSingle line of text(Default Title)
Week EndingDate and Time
Current Project Finish DateDate and Time
Current PhaseChoice
How to validate SharePoint Online list date column

1. On the SharePoint list, click on the drop-down of [Week Ending] column -> Select Column Settings -> Tap on Edit.

Date column validation in SharePoint Online

2. In the Edit column pane, click on the More options drop-down.

Date validation in SharePoint

3. In the Formula dialogue box, provide the formula below.

=OR(WEEKDAY(WeekEnding)=1,WEEKDAY(WeekEnding)=7)

Where WeekEnding is the internal name of that column.

In the User Message box, specify the message display if the validation is not satisfied. Click on the Save button.

SharePoint Date & Time Column Validation

4. Now, we have validated the date from the Week Ending column to be selected only on weekends, such as Saturday and Sunday.

5. Create an item in the SharePoint list by adding the weekday date in the Week Ending column.

Validate Date&time to allow weekends in SharePoint

Output:

6. As you can see from the above image, whenever we try to create a new SharePoint list with a [Week Ending] column for any weekday, it displays an error message with a validation message.

After exiting from the grid view, the changes won’t be saved.

Refer to the image below:

Validate SharePoint Date &Time Column to Choose Only Weekends

This is how to validate the SharePoint date &time column to select only weekends.

Conclusion:

I hope this SharePoint blog post helped you solve your issues with date column validation, which allows you to choose only weekends from the calendar.

You can also visit:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…