Oct 02, 2020 09:25 AM
Hi everybody
I’m looking for a formula that goes like this:
IF: Created time is in week no. 40 then “A”
IF: Created time is in week no. 41 then “B”
IF: Created time is in week no. 42 then “C”
I tried to do it myself… Nearly had it (I think) But I got errors.
Can you guys help me?
Oct 02, 2020 01:18 PM
Since you’re comparing the same value multiple times, I would recommend using a SWITCH()
function. Your formula will look something like this:
SWITCH(
WEEKNUM(CREATED_TIME()),
40, 'A',
41, 'B',
42, 'C'
)
Oct 05, 2020 07:20 AM
Hi Kamille,
Thank you! That one helped me a lot. I try to do it with IF statements at first. I didn’t even know the SWITCH() function excisted. It kinda works now but I have a second problem… Is there a way to start counting the weeknumbers from sunday till sunday instead of monday till monday?
Let me know if you can help.
Thanks.
Oct 05, 2020 07:51 AM
Yes. You pass either “Sunday” or “Monday” as the second argument in the WEEKNUM()
function.
Oct 05, 2020 08:01 AM
Thanks for the fast reply.
I think I already did it myself by adding: DATEADD({Created_time}, -1, ‘days’)
I really wonder what you thought would also work tho :slightly_smiling_face:
Gr.