Bug 139450 - CONDITIONAL FORMATTING in Calc: smear of conditional formatting
Summary: CONDITIONAL FORMATTING in Calc: smear of conditional formatting
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-06 18:11 UTC by daniele
Modified: 2021-01-06 18:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
example (13.57 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-01-06 18:23 UTC, daniele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description daniele 2021-01-06 18:11:25 UTC
Description:
The condition "giorno.settimana(a2;2)=6" (in italian) of conditional formatting on a range of dates produces a fill of colors even in empty cells. With values 1,2,3,4,5,7 the formula works correctly

Steps to Reproduce:
1.a1 = 31/12/2020
2.a2 = a1 + 1
3.copy a2 down to line 182
4.move the January days to B2
5.move the days of February to D2
...
9.move the days of June to L2
10.select B2: L32
11.cell format to DD
12. select range B2:L32
13.conditional formatting B2: L32
14.condition
14.a- the formula is -> GIORNO.SETTIMANA(B2;2)=7
14.b- new style
14.c- background -> RED 3
14.d- font -> 12 pt
14.e- font color -> yellow 2
15. OK
16. Correct conditional formatting.
17. Manage rules
17.a change in the formula the "7" to "6"


Actual Results:
the conditional formatting fills all the empty spaces in the range.

Expected Results:
the same results as the values 1,2,3,4,5,7


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Versione: 7.0.3.1 (x64)
Build d7547858d014d4cf69878db179d326fc3483e082
thread CPU: 4  SO:Windows 10.0 Build 19041
Resa Interfaccia Skia/Raster;  VCL: win
Locale it-IT (it_IT); interfaccia utente: it-IT
Varie: Calc:threaded
Comment 1 m_a_riosv 2021-01-06 18:13:00 UTC
Please attach a sample file to test.
Comment 2 m_a_riosv 2021-01-06 18:16:10 UTC
I think you need to verify in the condition if the cell is empty or zero, because zero/empty represent also a date, 30/12/1899.
Comment 3 daniele 2021-01-06 18:23:08 UTC
Created attachment 168722 [details]
example
Comment 4 m_a_riosv 2021-01-06 18:29:38 UTC
As I was thinking, comment#2.

With a formula like:
IF(ISBLANK(B2);0;WEEKDAY(B2;2)=$P$2)
make it work.