IF Created time is in week no ... then

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?

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'
)
1 Like

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.

Yes. You pass either “Sunday” or “Monday” as the second argument in the WEEKNUM() function.

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 :slight_smile:

Gr.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.