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.
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.
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.
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.
(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 ;-)
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. :)
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. ]
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present on a currently supported version of LibreOffice (5.0.5 or 5.1.0) https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa Thank you for your help! -- The LibreOffice QA Team This NEW Message was generated on: 2016-02-21
(In reply to QA Administrators from comment #8) Problem is still there in version 5.0.4 (Windows 7).
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
Olivier, can this be considered fixed by the above commit or are you planning to add more commits / cherrypick to 7.4?
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.