Libre Calc / Excel - conditional formatting: WEEKDAY()
1 Attachment(s)
Hi,
As you can see in the attachment I created calendar in row 2. With conditional formatting, I have highlighted all weekends with orange color : Code:
=OR(WEEKDAY(D2)=1;WEEKDAY(D2)=7) whenever there is =OR(WEEKDAY(D2)=1;WEEKDAY(D2)=7) - it stands for: Saturada and Sunday - highlight whole column (or at least 10 rows of that specific column). You can better see an example on columns: I,J in attached screenshot. Does anyone know how to do that? What I have came up for now, is the following condition but this is just static and does not refer to WEEKDAY() Code:
=MOD(COLUMN();7)=1 |
To get the value of the a named cell, you can use INDIRECT - it accepts either A1 syntax, or R#C# syntax
The first is easiest, you can obtain it with ADDRESS(row,col). So putting those together you can obtain the weekday of the date in the second row like so: Code:
=WEEKDAY(INDIRECT(ADDRESS(2,COLUMN()))) So the final condition would look like: Code:
=MOD(WEEKDAY(INDIRECT(ADDRESS(2,COLUMN()))),7) <= 1 |
Thanks!
That worked :) |
All times are GMT -5. The time now is 08:04 AM. |