我试图获得去年的日期,但与选定的一周相同。这意味着如果用户选择星期四的2013年12月5日,该公式将选择2012年12月6日也是星期四。任何帮助将不胜感激。
答案 0 :(得分:1)
使用字段或参数的名称查找/替换“Today()”。
=Switch (
WeekDay(Today())-WeekDay(DateAdd("d",-365,Today())) = 0, DateAdd("d",-365,Today()),
WeekDay(Today()) > WeekDay(DateAdd("d",-365,Today())), DateAdd("d",(-365)+ABS(WeekDay(Today())-WeekDay(DateAdd("d",-365,Today()))),Today()),
WeekDay(Today()) < WeekDay(DateAdd("d",-365,Today())), DateAdd("d",(-365)-ABS(WeekDay(Today())-WeekDay(DateAdd("d",-365,Today()))),Today())
)