Bug 157062 - There should be a version of OFFSET() allowing for an offset concerning the sheet index.
Summary: There should be a version of OFFSET() allowing for an offset concerning the s...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-02 10:57 UTC by Wolfgang Jäger
Modified: 2023-10-04 11:03 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Jäger 2023-09-02 10:57:18 UTC
Say OFFSET2() [or OFFSET.E() or similar] has an additional parameter in the first place behind the "Reference R".
This parameter should be specified "Integer SheetOffset" and have the expected semantics.
Comment 1 Stéphane Guillou (stragu) 2023-09-28 16:03:20 UTC
Thanks for the suggestion, Wolfgang.

For a workaround, not sure if this works for you: https://stackoverflow.com/questions/45807823/using-offset-with-a-3d-range-range-across-multiple-sheets

Sounds like a pretty niche use, but what do you think, Eike?
I haven't really delt with new function requests before.
Comment 2 ady 2023-09-28 23:27:42 UTC
FWIW...

Using relative addresses for worksheets would be a solution for some use-cases without needing a new function. That would not be the same exact method as "pointing to the next/prior Nth worksheet" (similar to the offset addressing), but still.

Regarding cell addresses vs worksheet addresses, the former are always named in a standard way (A1 or R1C1, and their respective absolute and relative notations), whereas the later are not; there is not standardized name format for worksheets). I assume this would be an important factor to consider for such suggested "offset-like" function, and (probably) it would be one important reason for the difficulties to precisely define the function and its arguments.
Comment 3 Eike Rathke 2023-10-04 11:03:28 UTC
(In reply to ady from comment #2)
> there is not standardized name format for worksheets
That wouldn't matter though, as a reference internally resolves to numeric (absolute or relative) values, including the sheet, so $Sheet1.$A$1 (with Sheet1 being the first sheet) points to a cell (0,0,0) and with a sheet-offset of +1 could point to (1,0,0).

A tricky part would be scenarios, as they are managed as hidden sheets, e.g. for Sheet1 with one scenario the scenario would be a second related sheet and a following Sheet2 would internally be the third sheet (can easily be seen in the Navigator and with =SHEET(Sheet2.A1) that results in 3), so (0,0,0) +1 sheet would not be (1,0,0) but (2,0,0) instead.