Bug 151982 - Variables returning different values depending on the cell they are in
Summary: Variables returning different values depending on the cell they are in
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.1.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-09 19:32 UTC by pajaro
Modified: 2022-11-10 12:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
c3 and g55 value is different (45.15 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-11-09 19:32 UTC, pajaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pajaro 2022-11-09 19:32:21 UTC
Created attachment 183508 [details]
c3 and g55 value is different

I wonder why c3 and g55 return different values on the same sheet

They are both =daysOff2
cell c3 is =daysOff2 and gives 123
cell g55 is =daysOff2 and gives 313

I expect them to return the same value anywhere on the same sheet
Comment 1 m_a_riosv 2022-11-09 23:21:53 UTC
I think you are misinterpreted how name ranges work.

If you go to manage named ranges/expressions, staying in C3 or staying in D55.
While you are in C3, the formula is:
relativeTotalDays-COUNTIF(D3:WX3; ">0") -COUNTIF(D2:WX2; ">0")
While in G55, the formula is:
relativeTotalDays-COUNTIF(H55:XB55; ">0") -COUNTIF(H54:XB54; ">0")

In the COUNTIF you have relative addresses, please take a look on https://wiki.documentfoundation.org/Macros/Calc/ba020
Comment 2 pajaro 2022-11-10 12:04:24 UTC
Thanks!

The link you gave me is very hard to understand for normal user like me

But I already do understand relative addresses, so i did fix it

Thanks again!