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
vasu takasivasu takasi 

how to get week name from a date field

hi

i need a formula to display name of the week form a date field called date_of_birth.

Please show  me the solution.

Best Answer chosen by Admin (Salesforce Developers) 
vasu takasivasu takasi
This example calculates the day of the week as a number (0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, etc.) for Opportunity Close Date. Formula ReturnType: Number Formula: MOD( {!CloseDate} - DATE(1900, 1, 6), 7) .............................................................................................................................................. ................................................................................................................................................. A text version of this formula could spell out the day of the week: CASE(MOD( {!CloseDate} - DATE(1900, 1, 6), 7), 0, "Saturday", 1, "Sunday", 2,"Monday", 3, "Tuesday", 4, "Wednesday", 5, "Thursday", 6,"Friday","")

All Answers

Navatar_DbSupNavatar_DbSup

Hi,


I think you want to display 1, 2, 3 and 4 as week value. Try the below formula and made changes accordingly:
FLOOR(DAY( Datevalue(CreatedDate))/7 ) + 1

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

vasu takasivasu takasi
its showing error as Incorrect argument type for function 'datevalue()'.
vasu takasivasu takasi
This example calculates the day of the week as a number (0 = Saturday, 1 = Sunday, 2 = Monday, 3 = Tuesday, etc.) for Opportunity Close Date. Formula ReturnType: Number Formula: MOD( {!CloseDate} - DATE(1900, 1, 6), 7) .............................................................................................................................................. ................................................................................................................................................. A text version of this formula could spell out the day of the week: CASE(MOD( {!CloseDate} - DATE(1900, 1, 6), 7), 0, "Saturday", 1, "Sunday", 2,"Monday", 3, "Tuesday", 4, "Wednesday", 5, "Thursday", 6,"Friday","")
This was selected as the best answer