I know this should be easy, but I keep tying myself in knots over this one.
I have a date selected by the User.
I'm trying to find a simple way of working out how many days before that date is a specific "day name".
For example if I take the date as 23/12/2019, I want to find out how many days to go back to find the previous "Tue".
In this case, as 23/12/2019 is a Monday, I need to go back 6 days to get to 17/12/2019.
Both the date and the "target day name" vary.
I know I can do it with lots of IF or SELECT statements, but I'm sure there must be a very simple formula to generate what I need, but I just can't figure out what the formula is.
Can any kind soul help?
I have a date selected by the User.
I'm trying to find a simple way of working out how many days before that date is a specific "day name".
For example if I take the date as 23/12/2019, I want to find out how many days to go back to find the previous "Tue".
In this case, as 23/12/2019 is a Monday, I need to go back 6 days to get to 17/12/2019.
Both the date and the "target day name" vary.
I know I can do it with lots of IF or SELECT statements, but I'm sure there must be a very simple formula to generate what I need, but I just can't figure out what the formula is.
Can any kind soul help?