
Originally Posted by
CK76
In WEEKDAY() function, without optional argument for return type, Sunday is considered first day of week.
Sun to Sat is assigned numbers 1 to 7.
There is 7 days in a week... so by adding 7 to current day, you are in next week on same day '2/7/2019'.
Subtract Tuesday's value (3) from current date's weekday value (ex. Today '1/31/2019' = 5).
This will give you number of days to go back to Tuesday.
So '2/7/2019' - 2 = '2/5/2019'.
If function is used to check if the date in A1 falls on Tuesday. If it does, just add 7 to current date to get next Tuesday.
Same logic is used for =A2+7-WEEKDAY(A2-3)*(WEEKDAY(A2)<>3)
As false in Excel evaluate to 0. If A2 is Tuesday...
=A2+7-(2)*(0)
=A2+7
Otherwise...
=A2+7-(2)*(1)
Bookmarks