How to convert Day name to weekday number?

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.

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
)

Screenshot 2022-05-31 at 6.47.46 PM

1 Like

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 :smiley:

Sincerely appreciate your effort. I will start using this.

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.