Bug 89358 - array references for a text argument in calc functions are not explained in Libreoffice help
Summary: array references for a text argument in calc functions are not explained in L...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-13 08:37 UTC by Winfried Donkers
Modified: 2023-01-02 10:27 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
demonstration of the problem (9.52 KB, application/vnd.oasis.opendocument.spreadsheet)
2015-02-13 08:41 UTC, Winfried Donkers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Winfried Donkers 2015-02-13 08:37:51 UTC

    
Comment 1 Winfried Donkers 2015-02-13 08:41:56 UTC
Created attachment 113359 [details]
demonstration of the problem

When a function with a text argument is used with an array argument instead, the result is unpredictable for a common user.

The problem is that ScInterpreter::GetString() is given an svDoubleRef and then gets a single cell dependent on the position of the formula.
Comment 2 m_a_riosv 2015-02-13 23:37:47 UTC
Hi Winfried,

as your comment on the code, it shows the value of the same row/column when the range has only one column/row.

It's the same with numeric arguments, or without function, e.g. multiplying the array for a number with number values or concatenating with text/numeric values.

IMHO if the range has two or more columns and rows, it's no possible resolve what value must be returned, except always the left column for the same row or the first row for the same column is returned.

Maybe it should be returned an error when an array argument is not used inside an array function/formula. This can avoid the mistake of enter an array formula not in the right way. But perhaps could leads at collateral issues on how some users are using it.
Comment 3 Winfried Donkers 2015-02-14 15:50:50 UTC
Open Document Format for Office Applications (OpenDocument) Version 1.2,
Part 2: Recalculated Formula (OpenFormula) Format, par 6.3.3 (http://docs.oasis-open.org/office/v1.2/cos01/OpenDocument-v1.2-cos01-part2.html#__RefHeading__1017984_715980110)
explains the behaviour.
So far, nothing is wrong.

However, I think this behaviour looks weird for a common user. More so, because I can't find any explanation in the LibreOffice help.
I 'modify' this bug report to a request to add this behaviour to LibreOffice help.
Comment 4 m_a_riosv 2015-02-14 17:48:36 UTC
Thanks for the link.

Seems fine being explained in the help.

I think is a not very used option, I don't remember any question about this matter in no one of Ask, LibreOfficeForum, Aoo forum.

It is in the Aoo wiki: https://wiki.openoffice.org/wiki/Documentation/How_Tos/Using_Arrays#Array_formulas but I can't find in our wiki/help.

In https://help.libreoffice.org/4.3/Calc/Array_Functions#What_is_an_Array.3F nothing about this is mentioned.
Comment 5 Winfried Donkers 2015-02-16 06:56:26 UTC
(In reply to m.a.riosv from comment #4)
> Seems fine being explained in the help.

Hi mariosv,

I don't understand your meaning:
do you mean that you think it _is_ explained in the current help,
do you mean that it isn't explained in the help roght noew, but explaining it in the help would be great,
or even something quite different?

Of course, it's because of my lack of skills that I don't understand you, bit I would like to understand you ;-)
Comment 6 m_a_riosv 2015-02-16 11:32:34 UTC
Sorry Winfried, sure my bad, because I'm not explaining in an understandable way.

It is not explained in the current help,
but "explaining it in the help would be great".

Thanks. :)
Comment 7 Winfried Donkers 2015-02-17 08:21:48 UTC
Extract from messages on the dev-mailinglist:
[ erack:
Something is hidden in the help for "Array Functions":

| Using Array Formulas in LibreOfficeDev Calc You can also create a 
| "normal" formula in which the reference range, such as parameters, 
| indicate an array formula. The result is obtained from the 
| intersection of the reference range and the rows or columns in which 
| the formula is found. If there is no intersection or if the range at 
| the intersection covers several rows or columns, a #VALUE! error 
| message appears. The following example illustrates this concept:

And then follows a description of how to create array formulas, which is exactly _not_ about intersections..

While the hint about the non-array "normal" formula mode is helpful there to outline the difference, the actual "what happens in an intersection and when and why ..." should (also?) be covered at a more prominent place
]

[ kohei:
FYI, this is also known as "implicit intersection" in Excel terminology.
If you google the phrase "excel implicit intersection" you'll get quite a few hits along with some interesting narratives.
]
Comment 8 QA Administrators 2016-02-21 08:36:28 UTC Comment hidden (obsolete)
Comment 9 Winfried Donkers 2016-02-22 06:58:51 UTC
(In reply to QA Administrators from comment #8)

Problem is still there in version 5.0.4 (Windows 7).
Comment 10 Commit Notification 2022-11-12 10:41:50 UTC
Olivier Hallot committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/help/commit/d26dc8bf2215097db8092428cc05a991aa03f8a4

tdf#89358 Example of implicit intersection for array formulas
Comment 11 Stéphane Guillou (stragu) 2022-11-21 08:20:51 UTC
Olivier, can this be considered fixed by the above commit or are you planning to add more commits / cherrypick to 7.4?
Comment 12 Stéphane Guillou (stragu) 2023-01-02 10:27:06 UTC
Fix verified in:

https://help.libreoffice.org/7.5/en-US/text/scalc/01/04060107.html

However, I encourage others familiar with the topic to check if the description is sufficient.