Bug 139649 - [1] Wrong condition behavior with cell range and sheet name
Summary: [1] Wrong condition behavior with cell range and sheet name
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.7.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 141389 (view as bug list)
Depends on:
Blocks: Conditional-Formatting
  Show dependency treegraph
 
Reported: 2021-01-15 14:47 UTC by kardjoe
Modified: 2022-07-08 07:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test condition (18.75 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-01-15 14:47 UTC, kardjoe
Details
Sample modified with more test (19.99 KB, application/vnd.oasis.opendocument.spreadsheet)
2021-01-16 01:31 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description kardjoe 2021-01-15 14:47:02 UTC
Description:
Sometimes in Libreoffice Calc I use condition to compare range of cells in one field with respective range of cells in another field using 'Conditional' button on the toolbar. I highlight cells instead of writing a range manually. Let's say I use option 'Cell value is' in 'Conditional formatting'. I choose 'less than' option, put cursor on the right field, than I highlight cells. Range of cells with sheet name appears in the field like $'Sheet name'.$A$1:$A$10. After clicking OK sometimes compare process go wrong. For example, if A1 is 1 and B1 is 1, formatting shows that A1 is bigger than B1.



Steps to Reproduce:
1. Create a sheet.
2. Fill range A1:A10 with some numbers.
3. Copy those numbers to range B1:B10 respectively.
4. Open 'Conditional' -> 'Manage'.
5. Click 'Add'.
6. Set 'Condition 1' as 'Cell value is'.
7. Set 'less than'.
8. Put cursor on the next field and highlight with cursor range of B1:B10.
9. Click 'Shrink' button at the left bottom corner.
10. Highlight range A1:A10.
11. Click OK.

Actual Results:
Number in one cell is highlighted as not equal to a number in respective cell in another field when two these numbers are actually equal.

Expected Results:
Numbers in respective cells should not be highlighted when they are equal and one use 'less than' condition.


Reproducible: Sometimes


User Profile Reset: Yes



Additional Info:
Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 24; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ru-RU (en_US.UTF-8); UI-Language: en-US
Calc: threaded

Not sure if it depends on if I compare a simple number and a function result or simple numbers.

Possible workaround - remove sheet name (like $'Sheet name') in 'Conditional Formatting' in the right field.

Example with a Calc sheet where I see such  behavior is attached. Look at F and G fields. I've faced this bug when I work with LO versions 6.4.6.2 and 7.0.4.2.
Comment 1 kardjoe 2021-01-15 14:47:40 UTC
Created attachment 168913 [details]
test condition
Comment 2 Roman Kuznetsov 2021-01-15 16:26:04 UTC
confirm in

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 94f6765d6ecc3145fa2d266231124003cf953118
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: CL

and in 3.5.7.2, I think it inherrited from OOo
Comment 3 m_a_riosv 2021-01-16 01:31:59 UTC
Created attachment 168927 [details]
Sample modified with more test

Seems the issue it's in relation with the use of the sheet name in the range to compare, behaving just the inverse it should be in the comparison, and comparing all with F2.

Works fine without sheet name, column K
Comment 4 Heiko Tietze 2022-07-08 07:29:06 UTC
*** Bug 141389 has been marked as a duplicate of this bug. ***