Hi all,

The specification of the TYPE function is in
https://docs.oasis-open.org/office/OpenDocument/v1.4/part4-formula/OpenDocument-v1.4-os-part4-formula.html#TYPE

A
If the argument of the TYPE function evaluates to an array, LibreOffice sometimes forces an array context, and the user cannot prevent this.
Returns single number 64
    =TYPE(COLUMN(B2:D2))
    =TYPE(LARGE(B34:B38;{1;2})
Generates array context
    {=TYPE(MUNIT(2))}
    {=TYPE({"A";999;"B"})}
I consider the latter to be an error.

B
Usually in array context, a function is applied individually to each element of the array in its argument.
That is not the case for the TYPE function.
    {=ISTEXT({"A";999;"B"})} returns array TRUE;FALSE;TRUE
    {=TYPE({"A";999;"B"})} returns array 64;64;64
However data type of argument of ISTEXT is 'Scalar', whereas for TYPE it is 'Any'. What is the expected behavior for evaluation in array context for the TYPE function? If iterating over the elements is desired, then I expect array 2;1;2 as result. Or TYPE({"A";999;"B"}) results in 64 because {"A";999;"B"} is an array and thus fits directly to Table 19 in the spec; an array context would then make no difference and result would be single value 64.

C
The data type of the argument 'Value' of function TYPE is 'Any'. What is the expected behavior, when 'Value' is a range? The spec has the rule, "If a Reference is provided, the reference is first dereferenced, and any formulas are evaluated." That is not clear to me. What is the result of applying the rule to B1:D1 in formula =TYPE(B1:D1), for example? LibreOffice calculates an 'implicit intersection'. Excel considers it to be an array and returns 64.

Kind regards,
Regina

Attachment: TYPE function on range and array.ods
Description: application/vnd.oasis.opendocument.spreadsheet

Reply via email to