Salesforce Weekday Formula

The Salesforce Weekday formula is used when you want to do a particular task based on the day of the week.

In this Salesforce tutorial, I will explain the weekday function of Salesforce with syntax and examples. I will also show you how to create weekday formula in Salesforce.

Salesforce Weekday

Salesforce Weekday is one of the Date and Time functions. The Salesforce Weekday function is used to find out the day of the week for the given date.

It returns the number for each day of the week; it returns 1 for Sunday and 7 for Saturday. You can use the weekday function in a scenario where you want to perform a task based on the day of the week, like you want to schedule and insight the task based on the salesforce day-of-week formula.

Moreover, below is the syntax for the weekday function in Salesforce.

  • date: It is the parameter for which you want to return the day of the week.

Weekday Example

Furthermore, let’s see some examples to understand how the weekday function works in the Salesforce formula.

Input FieldResult
WEEKDAY(Delivery_Date__c) Suppose the delivery date is 01-05-2024, and the day of this date is Wednesday.4
WEEKDAY(Campaign_Date__c) Suppose the campaign date is 20-04-2024, and the day on this date is Saturday.7

Create Salesforce Formula Day of Week

Below are the steps to create a formula to find the day of the week in Salesforce. Moreover, you can use the Salesforce formula weekday in both Salesforce Lightning and Salesforce Classic.

See also  Salesforce Date Formula Business Days

Step-1: Click on the Gear icon and select the Setup option to move to the setup. Then, click on the Object Manager tab given on the Nav Bar.

For example, a Campaign object from the list of objects.

weekday function salesforce
Weekday Formula in Salesforce Lightning Example

Step-2: Click on the Fields & Relationships option given on the leftside bar and click on the New button.

weekday salesforce
Use Weekday Formula in Salesforce Lightning

Step-3: Choose the Formula as the field type and then click on the Next.

salesforce weekday

Step-4: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter the field label as the Start Week Day.

After that, choose Number as the Formula Return Type and click the Next button.

salesforce weekday function

Step-5: Enter the Weekday formula in the advance formula editor. Here is the formula:

  • In this formula, use the WEEKDAY() to get the day of the week for the given date field called StartDate.

Click Check Syntax to make sure the formula is correct. You can add the Description and Help Text as options, and you can also state How you want to handle the blank field.

After that, click the Next button.

salesforce weekday formula

Step-6: Establish the field level security, choose the Profiles to whom you want to grant the edit access to the field, and then click on the Next button.

weekday formula salesforce

Step-7: Choose the Page Layout on which you want to add the field; if you don’t select the page layout, the field will not be added. Then, click on the Save button.

salesforce formula day of week

Let’s check how the weekday function in Salesforce works. Open the Campaigns, enter the date in the Start Day field, and in the Details section, you will get the day of the week in the Start Week Day field.

salesforce day of week formula

In this way, you can use the weekday function and create a weekday formula in Salesforce.

See also  Salesforce Formula Field to Calculate Age


I hope you understand the weekday function in Salesforce and how to create weekday formula in Salesforce with examples.

You may like to read: