May 31, 2022 03:19 AM
I have a column named Day name which is a single select field containing names of day - Monday, Tuesday, etc.
How can I create another column which gives the weekday number of this? I know I need to use Weekday() function, but how can I set it up such that it converts the string to work with Weekday() function?
Thanks.
Solved! Go to Solution.
May 31, 2022 03:48 AM
Hi Mayank, I don’t think the weekday()
function works for that as it expects a date
This formula should serve your needs, and you can modify the numbers as needed depending on when your week starts:
SWITCH(
Name,
'Sunday', 0,
'Monday', 1,
'Tuesday', 2,
'Wednesday', 3,
'Thursday', 4,
'Friday', 5,
'Saturday', 6
)
May 31, 2022 03:48 AM
Hi Mayank, I don’t think the weekday()
function works for that as it expects a date
This formula should serve your needs, and you can modify the numbers as needed depending on when your week starts:
SWITCH(
Name,
'Sunday', 0,
'Monday', 1,
'Tuesday', 2,
'Wednesday', 3,
'Thursday', 4,
'Friday', 5,
'Saturday', 6
)
May 31, 2022 04:55 AM
Thank you so much Adam!
Particularly thanks for taking the pain to write the entire function for me when you could’ve simply guided me :grinning_face_with_big_eyes:
Sincerely appreciate your effort. I will start using this.