This is driving me nuts! I found a very useful discussion here on how to calculate the date for a specific day in the future. From that, I modified it so I could get the output in the format I wanted, with dashes. I ended up with:
%ICUDateTimePlus%(7+5-DOW(NOW)) MOD 1%Days%MM-d-yy%
This gives me the date for next Sunday, but the wrong day of the week. In this case: Monday 12-25-16.
I understand the TimePlus part of it for adding time, the DOW is Day Of the Week, but I don’t understand MOD.
I also want a macro for “last Sunday” but I can’t get that to work either. I tried TimeMinus, I tried changing the numbers in the parenthesis and the MOD part, and just can’t crack it. Spent time reading the manual, still having trouble. Can someone save me from spending another couple hours on this? I just want a formula for last Sunday’s date in dash form, and one for next Sunday’s date in the same format. So close, but no cigar! And it’s killing me that I can’t figure it out myself.
That’s the one I referenced above, and it was your explanation in that post that I studied for so long last night and put me on the right path, so thank you. I still don’t get how it works though, mechanically – why the 7+5-… part? And what does the MOD part mean? When I tweak it, I get random stuff because I don’t understand those bits.
Any idea why I don’t see the “solved” checkbox - I looked on the discourse help pages and see where it is supposed to show up, but all I see are the heart to like the post, the link icon to share the post, the flag icon to privately flag it and the bookmark icon. No solved checkbox anywhere to be seen…
Does it go away if someone else has already checked it?
Nice, thank you very much! Did not expect this much attention to the topic at all. Really appreciate all the work you put into it. Surprised it takes so much code to get, but I’m not a developer so it’s probably just my ignorance. Works as expected!
Is there an easy way to get “the most recent Sunday?” For example, when I run this macro I get the Sunday of last week. What if I wanted the date of the most recent Sunday, regardless of the week? For example, now, on Tuesday, the desired result would be “Sun, Dec 25, 2016” instead of “Sun, Dec 18, 2016.” Or say it’s Tuesday, and I want the date of this coming Friday, not the Friday of next week? Would there have to be a conditional statement that sets the current week instead of the one before or after this one?