In this Salesforce Tutorial, we will learn the formula of Weekday. Moreover, we will go through the steps using the weekday formula in Salesforce Lightning and Salesforce Classic.
While working in an organization that uses Salesforce as a CRM tool, I got a task where I need to display the day of the week for a date field. So, to fulfill this requirement, I use the Weekday functionality of Salesforce.
If you want to learn How to use Weekday Advance Formula in Salesforce Lightning and Salesforce Classic, you have come to the right place.
The following are the topics that we will cover in this salesforce tutorial:
- How to use Weekday Formula in Salesforce Lightning
- How to use Weekday Formula in Salesforce Classic
How to use Weekday Formula in Salesforce Lightning
Here, are the steps to use the Weekday Advance Formula in Salesforce Lightning.
Step 1: Navigate to Salesforce Setup, by clicking on the Setup icon on the upper right side of the page.
Step 2: On the left side of the menu, click on Object Manager.

Step 3: Search for the object to which we want to get the Weekday. Here, I select the Campaign object from the list of objects.

Step 4: Click on Fields & Relationships.
Step 5: Then, click on New.

Step 6: Choose the Formula as the field type.
Step 7: To continue, click Next.

Step 8: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter Field Label as the Start Week Day.
Step 9: Choose Number as the Formula Return Type. Then, click Next.

Step 10: Enter the Weekday formula in the Advance Formula editor. Here, is the formula:
WEEKDAY(StartDate)
- In this formula, we use the WEEKDAY() formula to get the day of the week for the given date field called “StartDate”.
Step 11: Click Check Syntax to make sure the formula is correct.
Step 12: We can add the Description and Help Text as options, and we can also state how you want to handle the blank field.
Step 13: After that, click Next.

Step 14: Select the appropriate field Level Security and to make it visible to everyone, here we select the Visible checkbox.
Step 15: Select Next.

Step 16: Choose the Page Layout Name, for whom we want to add the formula field.
Step 17: To save the formula field, click Save.

We can use the formula field once we’ve created it. Let’s look at an example:
- Create a Campaign with the StartDay value field by opening the Campaigns object and saving it.
- After that, click on the Details section, and here the Start Week Day field will appear the week of the day.

As a result, we now know how to use Salesforce Lightning’s advanced formula to get the weekday from the date. Next, we’ll look at how to use Salesforce Classic’s advance formula to get the weekday from the date.
Read Convert DateTime to Date Salesforce
How to use Weekday Formula in Salesforce Classic
Here, are the steps to use the Weekday Advance Formula in Salesforce Classic.
Step 1: From the Salesforce Lightning to open your Salesforce Classic edition. Click on Avtar and click Switch to Salesforce Classic.

Step 2: Click on the Setup option.

Step 3: Scroll down to the Build section. Then under Customize, select the object for whom we want to get the weekday of the date. Here, I choose the Contacts from the object list.
Step 4: Click on the dropdown menu and select Fields.

Step 5: As you scroll down the page, click on the New button under Custom Fields & Relationships.

Step 6: Select the Formula as the field type.
Step 7: Click Next to proceed.

Step 8: Enter a Field Label for the formula, and the Field Name will be automatically populated. Here, I enter Field Label as the Birth Date Week.
Step 9: Choose Number as the Formula Return Type and then click Next.

Step 10: Enter the formula to get the Weekday of the Date in the advance formula editor. The formula is as follows:
WEEKDAY(Birthdate)
- In this formula, we use the WEEKDAY() formula to get the day of the week for the given date field called “Birthdate”.
Step 11: To verify that the formula is valid, click Check Syntax.
Step 12: We can specify how you want to handle the empty field and include the Description and Help Text optionally.
Step 13: Then, click Next.

Step 14: Choose the appropriate Field’s Level Security, and then check the box Visible to make it visible to all.
Step 15: Click Next.

Step 16: Choose the Page Layout Name for which the formula field is to be added.
Step 17: Click Save to save the formula field.

Once we’ve defined the formula field, we may use it. Let’s explore an example:
- Create a new contact with the Birth Date field value by opening the contacts object and saving it.
- After that, click on the Details section, and here the Birth Date Week field will appear with the weekday of the date.

In a conclusion, we now understand how to get the weekday from the date using Salesforce Classic’s advanced formula.
Also, Read:
Conclusion
In conclusion, we have learned the advance salesforce formula to get the Weekday of the date field.
Moreover, we have learned that both Salesforce Classic and Salesforce Lightning provide a simple procedure to get the Weekday of the date field.
In addition to this, the following are the topics that we have discussed:
- How to use Weekday Formula in Salesforce Lightning
- How to use Weekday Formula in Salesforce Classic
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.