Bug 124728 - Function CHOOSE doesn't allow to create matrix
Summary: Function CHOOSE doesn't allow to create matrix
Status: CLOSED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2019-04-14 07:55 UTC by gmolleda
Modified: 2019-05-06 09:28 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
vlookup choose example (9.20 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-04-15 17:30 UTC, Oliver Brinzing
Details
screenshot with two files with different separator (103.02 KB, image/png)
2019-05-03 19:23 UTC, gmolleda
Details
testcase with other separator (12.26 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-05-03 19:26 UTC, gmolleda
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gmolleda 2019-04-14 07:55:52 UTC
In english in the end

Esperanto:
En aliaj tabelkalkuliloj, vi povas modifi matricon per la funkcio CHOICE:
	A	B
1	a	1
2	b	2
3	c	3
4	d	4
5
6
7
8
9

Elektante A6: B9-ĉelojn, vi skribas =CHOICE({2 1};a1:a4;b1:b4) kaj premu KTRL + MAJ + ENEN-KLAVO por akiri novan matricon:
	A	B
1 ... 5 vicoj kiel supro

6	1	a
7	2	b
8	3	c
9	4	d

Vi nun povas uzi ĉi tiun konduton por serĉado: =VLOOKUP(2;CHOICE({2\1};a1:a4;b1:b4);2;FALSE) kaj vi akiras la rezulton "b".

Español:
En otras hojas de cálculo, puedes modificar una matriz con la función ELEGIR:
	A	B
1	a	1
2	b	2
3	c	3
4	d	4
5
6
7
8
9

Selecciona las celdas A6:B9, escribe =ELEGIR({2\1};a1:a4;b1:b4) y pulsa las teclas CTRL+SHIFT+ENTER para obtener una nueva matriz:
	A	B
1...5 filas como arriba

6	1	a
7	2	b
8	3	c
9	4	d

Se puede usar este comportamiento para búsquedas: =BUSCARV(2;ELEGIR({2\1};a1:a4;b1:b4);2;FALSO) y obtener así el resultado "b".


English:
In other spreeadsheets, you can modify a matrix with la CHOICE function:
	A	B
1	a	1
2	b	2
3	c	3
4	d	4
5
6
7
8
9

Selecting A6:B9 cells, you write =CHOICE({2\1};a1:a4;b1:b4) and push CTRL+SHIFT+ENTER for obtain a new matrix:
	A	B
1...5 rows as top

6	1	a
7	2	b
8	3	c
9	4	d

You can use this behaviour for search: =VLOOKUP(2;CHOICE({2\1};a1:a4;b1:b4);2;FALSE) and you obtain the result "b".
Comment 1 gmolleda 2019-04-14 07:57:15 UTC
Related bugs: https://bugs.documentfoundation.org/show_bug.cgi?id=123746
Comment 2 Eike Rathke 2019-04-15 14:12:02 UTC
Bug 123746 is not related at all.
Comment 3 Eike Rathke 2019-04-15 14:30:18 UTC
What is your actual problem and in which version?

  =CHOOSE({2,1},A1:A4,B1:B4)

as array formula produces a result matrix of

  1  a
  2  b
  3  c
  4  d

and

  =VLOOKUP(2,CHOOSE({2,1},A1:A4,B1:B4),2,0)

returns b. Note that the ',' separator in {2,1} is the actual Array column separator defined under Tools -> Options -> Calc -> Formula, which differs for different locales.

This in all versions since LibreOffice 5.3.7 (don't have earlier to test). You didn't tell your version, but maybe you should just upgrade.
Comment 4 Oliver Brinzing 2019-04-15 17:30:01 UTC
Created attachment 150776 [details]
vlookup choose example
Comment 5 gmolleda 2019-04-15 17:33:54 UTC
Thanks, I did not know that {2\1} in other spreadsheets is {2;1} or {2,1} in Calc.
All right.
Comment 6 gmolleda 2019-05-02 17:24:44 UTC
I watch it bad, the separator is dot (.)
Comment 7 gmolleda 2019-05-03 19:19:48 UTC
Now, if I open the attach file, the separator character (?) of {2?1} is not comma (,) and is not ;, now is dot (.)
I have two files, in my spanish version the separator character is ; one time and . other time, in different files open at same time.
Comment 8 gmolleda 2019-05-03 19:23:28 UTC
Created attachment 151166 [details]
screenshot with two files with different separator

The name of attach is elegirambos.png, the english translation is choice_both.png
Comment 9 gmolleda 2019-05-03 19:26:39 UTC
Created attachment 151167 [details]
testcase with other separator

This is the other file that I open at same time the other file testcase. Each one with a different separator working in my computer: LibreOffice 6.0.7.3 in spanish language, my operating system is LinuxMint 19 in Esperanto language.
Comment 10 Eike Rathke 2019-05-06 09:28:12 UTC
Why is this reopened? The separators to be used entirely depends on the settings under Tools -> Options -> Calc -> Formula, for which the defaults depend on the UI language used.
Closing again.