Bug 161841 - Add ARRAYFORMULA function
Summary: Add ARRAYFORMULA function
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-29 21:18 UTC by Óvári
Modified: 2024-08-31 22:06 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 Óvári 2024-06-29 21:18:49 UTC
Description:
Alternative to pressing Ctrl+Shift+Enter (CSE formulae) (or Cmd+Shift+Enter on macOS) while editing a formula

https://support.google.com/docs/answer/3093275

Thank you

Steps to Reproduce:
Interoperability with Google Sheets

Actual Results:
Error if ARRAYFORMULA() function is used

Expected Results:
Work if ARRAYFORMULA() function is used


Reproducible: Always


User Profile Reset: No

Additional Info:
ARRAYFORMULA
https://support.google.com/docs/answer/3093275

Enables the display of values returned from an array formula into multiple rows and/or columns and the use of non-array functions with arrays.
Sample Usage

ARRAYFORMULA(SUM(IF(A1:A10>5, A1:A10, 0)))

ARRAYFORMULA(A1:C1+A2:C2)
Syntax

ARRAYFORMULA(array_formula)

* array_formula - A range, mathematical expression using one cell range or multiple ranges of the same size, or a function that returns a result greater than one cell.

Notes

* Many array formulas will be automatically expanded into neighboring cells, obviating the explicit use of ARRAYFORMULA.

* Pressing Ctrl+Shift+Enter while editing a formula will automatically add ARRAYFORMULA( to the beginning of the formula.

* Note that array formulas cannot be exported.

See Also

ARRAY_CONSTRAIN: Constrains an array result to a specified size.
https://support.google.com/docs/answer/3267036?sjid=16672828875549345965-AP
Comment 1 m_a_riosv 2024-06-29 21:37:34 UTC
+1

I think the need of a function for that was already reported, but I can't find it.
Comment 2 Stéphane Guillou (stragu) 2024-07-16 06:14:19 UTC
The example formula ARRAYFORMULA(A1:C1+A2:C2) (in cell D1) is exported from Google Sheets as e.g.:

- ODF:
<table:table-cell table:style-name="ce7" table:number-matrix-columns-spanned="3" table:number-matrix-rows-spanned="1" table:formula="of:=[.A1:.C1]+[.A2:.C2]" office:value-type="float" office:value="5" calcext:value-type="float"><text:p>5</text:p>

- OOXML:
<c r="D1" s="4"><f t="array" ref="D1:F1">A1:C1+A2:C2</f><v>5</v></c>

When imported in LO, it is displayed in the curly braces syntax, in both ODF and OOXML.

and is imported back in Google Sheets wrapped in ARRAY_CONSTRAIN():

=ARRAY_CONSTRAIN(ARRAYFORMULA(A1:C1+A2:C2), 1, 3)

Would be good to inverstigate what happens in the case "use of non-array functions with arrays".
Comment 3 Óvári 2024-08-06 21:55:54 UTC
Draw the MandelBrot Set in LibreOffice Calc, using only formulae
https://ask.libreoffice.org/t/draw-the-mandelbrot-set-in-libreoffice-calc-using-only-formulae/107400

Bug 126573 - Add array functions in Calc: FILTER, SORT, SORTBY, UNIQUE, SEQUENCE, RANDARRAY implements SEQUENCE and UNIQUE functions in LibreOffice Calc 24.8.
https://bugs.documentfoundation.org/show_bug.cgi?id=126573

How To Draw The MandelBrot Set In Google Sheets, Using Only Formulas
https://www.benlcollins.com/spreadsheets/how-to-draw-the-mandelbrot-set/
Comment 4 Óvári 2024-08-06 21:57:12 UTC
[Bug 105683] Allow expressions with references in inline arrays, not only constants
Comment 5 george 2024-08-31 19:07:23 UTC
This function ( https://support.google.com/docs/answer/3093275?hl=en&sjid=13859858089336346657-EU ) is powerful and now that LO calc implemented some array functions (in 24.8 like filter, sort etc.) it is high time more array functions are implemented. Those functions are used for many years by google sheets or ms excel, so it is imperative for lo calc to implement them as well.

Arrayformula is one of those functions.

Thank you.
Comment 6 Óvári 2024-08-31 20:37:44 UTC
(In reply to george from comment #5)

Can you please change the status to from UNCONFIRMED to NEW? Thank you