Uploaded image for project: 'OASIS Open Document Format for Office Applications (OpenDocument) TC'
  1. OASIS Open Document Format for Office Applications (OpenDocument) TC
  2. OFFICE-4166

Kind of result is unclear for function INDIRECT in array mode.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: OpenFormula
    • Labels:
      None

      Description

      Enter value 2 to cell A1 and value 3 to cell A2 and test the formulas =SUM(INDIRECT({"A1";"A2"})) and =INDIRECT({"A1";"A2"}) in array mode in several applications. The results are quite different.

      What kind is the result of expression INDIRECT({"A1";"A2"}) when used in array context?

      Section 6.3.4 has the description:
      A ForceArray attribute forces calculation of the argument's expression into non-scalar array mode. This means that no implied intersection is performed, instead where a reference to a single cell is expected and multiple cells are provided, iteration over the multiple cells is performed and results are stored in an array that is passed on.

      But that is not applicable here, because INDIRECT does not expect a reference to a single cell but a text.

      The "See also" there links to section 3.3 and that has:
      When evaluating a formula in 'matrix' mode, and a non-scalar value is passed to a function argument that expects a scalar, the function is evaluated multiple times, iterating over the non-scalar input(s) and putting the function result into a matrix at the position corresponding to the input.

      Only sure is, that in 'matrix' mode, we have to calculate INDIRECT("A1") and INDIRECT("A2"). INDIRECT("A1") returns the reference A1 and INDIRECT("A2") returnd the reference A2.
      But what do we get by "putting the function result into a matrix"?

      Could it be something of data type Array (4.10)? Then we have problems to build SUM(INDIRECT({"A1";"A2"})) [The example used in Note 7 in section 3.3], because SUM expects a NumberSequenceList and conversion of Array to NumberSequenceList is not specified [at least I do not find it].

      We cannot use symbol 'Array' from the EBNF, because that describes a file format, but here we have an intermediate result, that is not stored into cells.

      Is 'matrix' a range in a fictive, temporarily sheet? And the result of INDIRECT({"A1";"A2"}) would then be a reference to this range?

      As the results in the applications are different, it cannot be solved by common sense but needs to be specified more exactly than it is currently.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              regina.henschel Regina Henschel
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: