Description: Linux LibreOffice v6.4.7.2 OFFSET has an error when the 1st arg is a named range that refers to a column not a single cell. If all args are fully specified it works as expected using the first cell referenced in the named range. If however the length and width of the returned array are not specified (which default to 1,1), then it does not matter what is input for the row arg, the result is always the same cell value. Obviously, the workaround is to specify all args, but unintended errors can occur if you don't know, so could this be flagged for future fix please. Thank you from longtime grateful user of LO CALC Steps to Reproduce: 1.create named range of multiple cells say myRange 2.create cell =OFFSET( myRange, 1, 0) 3.vary row arg to see the same value 4. now amend OFFSET to add defaults explicitly 1,1 - do same vary row Actual Results: see above Expected Results: see above Reproducible: Always User Profile Reset: No Additional Info: see above
Please can attach your sample file to test.
(In reply to Simon from comment #0) > 1.create named range of multiple cells say myRange > 2.create cell =OFFSET( myRange, 1, 0) This doesn't work at all and gives a "#VALUE!" (wrong data type) error. This needs to be an array formula "{=OFFSET( myRange;1;0)}" to work, if myRange is a multicell range.
Created attachment 173044 [details] spreadsheet showing error
(In reply to m.a.riosv from comment #1) > Please can attach your sample file to test. Done
(In reply to Uwe Auer from comment #2) > (In reply to Simon from comment #0) > > 1.create named range of multiple cells say myRange > > 2.create cell =OFFSET( myRange, 1, 0) > > This doesn't work at all and gives a "#VALUE!" (wrong data type) error. This > needs to be an array formula "{=OFFSET( myRange;1;0)}" to work, if myRange > is a multicell range. NO ! See attachment
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018434_715980110 Tested with excel and result is the same as in Calc.
Simon please retest your problem in latest 7.4.2 version
Dear Simon, This bug has been in NEEDINFO status with no change for at least 6 months. Please provide the requested information as soon as possible and mark the bug as UNCONFIRMED. Due to regular bug tracker maintenance, if the bug is still in NEEDINFO status with no change in 30 days the QA team will close the bug as INSUFFICIENTDATA due to lack of needed information. For more information about our NEEDINFO policy please read the wiki located here: https://wiki.documentfoundation.org/QA/Bugzilla/Fields/Status/NEEDINFO If you have already provided the requested information, please mark the bug as UNCONFIRMED so that the QA team knows that the bug is ready to be confirmed. Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-NeedInfo-Ping
Using attachment 173044 [details], still repro in 7.6.alpha built 2023-04-27. In attachment 173044 [details], the named range upper-left cell is A3, but the OFFSET formula doesn't seem to take cell A3 as base. Instead, it just takes "one row up" as base (when the height and width arguments are not explicitly provided): for the formula in cell C7, the OFFSET() function is taking the base at cell A6 ("one row up"). In contrast, when the height and width arguments are provided, the base for OFFSET seems to be indeed cell A3 (upper-left cell of the range).
Using attachment 173044 [details] =SUM(OFFSET(myRange; 1; 0; 1;1)) Result: 2 (correct) =SUM(OFFSET(myRange; 1; 0)) Result: 152 (the enire named range except for the first upper-left value) Also, inherited from OOo.
(In reply to ady from comment #10) > . > =SUM(OFFSET(myRange; 1; 0)) > Result: 152 (the enire named range except for the first upper-left value) Because in this case, OFFSET return a reference, not a single cell. https://help.libreoffice.org/latest/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id3158430, see the samples.
(In reply to m.a.riosv from comment #11) > (In reply to ady from comment #10) > > . > > =SUM(OFFSET(myRange; 1; 0)) > > Result: 152 (the enire named range except for the first upper-left value) > > Because in this case, OFFSET return a reference, not a single cell. > https://help.libreoffice.org/latest/en-US/text/scalc/01/04060109. > html?DbPAR=CALC#bm_id3158430, see the samples. Right. Sorry for that; I got temporarily confused by the first results, without SUM(), and by the initial assumption in comment 0: (In reply to Simon from comment #0) > If however the length and width of the returned array are not specified > (which default to 1,1), then it does not matter what is input for the row > arg, the result is always the same cell value. That is not correct. When the height and width are not provided, the default is the same size as the original range. The initial question still remains. In the current behavior, OFFSET(myRange;1;0) (_not_ as array formula) provides not the first value of the new range (i.e. the second value of myrange) but the value corresponding to the same row in which the formula was introduced. I guess this behavior is probably useful in some cases in order to avoid using array formulas. I wonder what other tools do with the same formulas, _not_ using attachment 173044 [details] but rather entering them anew in a new, clean spreadsheet. (In comment 6, it is not clear to me whether raal tested by using the same file attachment 173044 [details] or by using a new empty spreadsheet, which might not provide the same result).
The result would be exactly the same if in place of the defined range name the explicit designator ($Sheet1.$A$3:$A$19 in the example) it stands for is used in the OFFSET() expression. That's because the expression is correctly evaluated in intersection mode. See subchapter 6.3.3 "Implied intersection" of "Open Document Format for Office Applications (OpenDocument) Version 1.3. Part 4: Recalculated Formula" To get what the bug reporter expected (hoped for) =OFFSET(myRange; 1; 0; 1; 1) entered for array evaluation would help. [INDEX() may also help to get a workaround. I think INDEX() is not eligible for intersection mode(?).] Suggest change to NOTABUG.
An actual bug shown in the example the bug reporter attached may be that the interection mode is handled as if the defined range was $Sheet1.$A$3:$A$20. But this is also the case if $Sheet1.$A$3:$A$19 is used explicitly.
Dear Simon, Please read this message in its entirety before proceeding. Your bug report is being closed as INSUFFICIENTDATA due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided): a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present b) Provide easy to reproduce steps – the simpler the better c) Provide any test case(s) which will help us confirm the problem d) Provide screenshots of the problem if you think it might help e) Read all comments and provide any requested information Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue. Please do not: a) respond via email b) update the version field in the bug or any of the other details on the top section of our bug tracker Warm Regards, QA Team MassPing-NeedInfo-FollowUp