Hey all,
Iโm testing out workday() in a template. Itโs Saturday, Feb 20th. Workday(today(),0) is returning Sunday, Feb 21. Iโm not sure what behaviour one should get doing (Saturday, 0), but it almost definitely shouldnโt be returning a weekend day.
This isnโt mentioned in the workday() docs. What should happen?
Edit: Possibly related: now() is seemingly returning the wrong time. The docs for date and time say it should reflect the current userโs time โ but as you can see in the screenshot (computer clock is bottom right), that is not the case. My timezone is set correctly to PST.
I m not perfectly sure but when we pass 0 as second argument, it seems the expression is always returning the data value passed to 1st argument regardless the 1st argument date is weekday or weekend.
On the documentation, the 2nd argument value is said to be either positive or negative value, not saying we are able to pass 0 value to it.
What do you want to acutally achieve with expression of
weekday(today(),0)
by the way.
I generate a list of all business days for 5 days including the day itโs generated on.
E.g. if I run it on Saturday, I want Monday through Friday
If I run it on Monday, I want Monday through Friday.
If I run it on Tuesday, I want Tuesday through Monday.
Not sure what you exactly want to do , but something like this?
IFS(
WEEKDAY(TODAY()=1,LIST(TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+4,TODAY()+5)),
WEEKDAY(TODAY()=2,LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+4)),
WEEKDAY(TODAY()=3,LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+6)),
WEEKDAY(TODAY()=4,LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+5,TODAY()+6)),
WEEKDAY(TODAY()=5,LIST(TODAY(),TODAY()+1,TODAY()+4,TODAY()+5,TODAY()+6)),
WEEKDAY(TODAY()=6,LIST(TODAY(),TODAY()+3,TODAY()+4,TODAY()+5,TODAY()+6)),
WEEKDAY(TODAY()=7,LIST(TODAY()+2,TODAY()+3,TODAY()+4,TODAY()+5,TODAY()+6))
)
@tsuji_koichi & @MultiTech_Visions , Thanks for your workarounds!
@Steve , Thanks for the suggestion. Itโs now been reported.
Iโm thinking the formula doesnโt know what to do with that input.
Alt version of @tsuji_koichiโs formula
Switch(WEEKDAY(TODAY()),
1, LIST(TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+4,TODAY()+5),
2, LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+4),
3, LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+3,TODAY()+6),
4, LIST(TODAY(),TODAY()+1,TODAY()+2,TODAY()+5,TODAY()+6),
5, LIST(TODAY(),TODAY()+1,TODAY()+4,TODAY()+5,TODAY()+6),
6, LIST(TODAY(),TODAY()+3,TODAY()+4,TODAY()+5,TODAY()+6),
7, LIST(TODAY()+2,TODAY()+3,TODAY()+4,TODAY()+5,TODAY()+6)
)
Weekday(today())
over and overLooks like a bug to me. Please report it to support@appsheet.com.
Reported. Thanks!
User | Count |
---|---|
32 | |
11 | |
3 | |
3 | |
2 |