Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I was using the below code in the background of the group to display BG color as red when the day is sunday. It works with the below code.
=if(weekday(date) ='Sun',Rgb(255,0,0))
Now I wanted to display BG color as red when the day is saturday and sunday. I used the below code but it is not working as expected. I know it is simple if statement only but not sure why it is not working.
=if(weekday(date) ='Sat' and weekday(date) ='Sun',Rgb(255,0,0))
=if(weekday(date) ='Sat','Sun',Rgb(255,0,0))
Can some one help me on this please.
Hi
try
=if(weekday(date) ='Sat' or weekday(date) ='Sun',Rgb(255,0,0))
Regards
Anders
Hi
try
=if(weekday(date) ='Sat' or weekday(date) ='Sun',Rgb(255,0,0))
Regards
Anders
Hi Anders
Thanks for your help! Thats does the trick!
Made very silly mistake again. Very bad of me. 😞
By the way still wondering why the below code didn't work 🙂
=if(weekday(date) ='Sat' and weekday(date) ='Sun',Rgb(255,0,0))
Hi,
AND means occurance of the two events simulteneouly ('Sat' and 'Sun'), which is not possible in a row, it could be either Sat or Sun. So.. AND doesn't work for your case.
Regards, tresesco
tresesco wrote:
AND means occurance of the two events simulteneouly ('Sat' and 'Sun'), which is not possible in a row, it could be either Sat or Sun. So.. AND doesn't work for your case. <div></div>
Thanks for the explanation!
I totally agree with you! I have done the mistake.
I didn't think of it when I was using AND in the if statement.