function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lukasz PiziakLukasz Piziak 

Week day formula

Hi,
How to create formula to populate current week days. e'.g today is 19th of October 2022, so the formula result should be Wednesday.

Thanks for help
Best Answer chosen by Lukasz Piziak
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

There is one () extra I guess. Can you try this.
 
CASE(WEEKDAY( SCMC__Planned_Completion_Date__c),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
"Saturday")

 

All Answers

Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

You can create a formula of return type text and use the below formule.
 
CASE(WEEKDAY(Today()),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
"Saturday")

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,
Lukasz PiziakLukasz Piziak
Hi Sai,

I have used Date field type 'SCMC__Planned_Completion_Date__c' in a formula and getting this error message

Error: Invalid Data.
Review all error messages below to correct your data.
Syntax error. Missing ')' (Related field: Formula)

CASE(WEEKDAY( SCMC__Planned_Completion_Date__c)()),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
"Saturday")

Can you advise?
Thanks
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

A small correction in your formule to remove () after the field. It is only required for Today() as it is funtion.
 
CASE(WEEKDAY( SCMC__Planned_Completion_Date__c)),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
"Saturday")

Thanks,
 
Lukasz PiziakLukasz Piziak
Hi, this time I'm getting this error:
Error: Invalid Data.
Review all error messages below to correct your data.
Syntax error. Extra ',' (Related field: Formula)

Thanks
 
Sai PraveenSai Praveen (Salesforce Developers) 
Hi,

There is one () extra I guess. Can you try this.
 
CASE(WEEKDAY( SCMC__Planned_Completion_Date__c),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
"Saturday")

 
This was selected as the best answer
Lukasz PiziakLukasz Piziak
Hi Sai, its working perfectly.
Many thanks for help