Bug 136209 - MINVERSE() returns err502
Summary: MINVERSE() returns err502
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
Reported: 2020-08-27 22:09 UTC by Alan Matthews
Modified: 2020-08-28 19:20 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

Spresdsheet showing problem (8.38 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-08-27 22:14 UTC, Alan Matthews
video showing another bug and how this works (1.27 MB, video/mp4)
2020-08-28 18:13 UTC, BogdanB

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Matthews 2020-08-27 22:09:34 UTC
=MINVERSE(Mat1) returns err502 where Mat1 is a square matrix range. It even produces the same result if the range reference (eg B2:E5) is used.

Steps to Reproduce:
1.Create a square matrix and define the range name (eg Mat1)
2.Select a range of cells of the same size that do not overlap the created data
3.Enter =MINVERSE(Mat1) and press shift + ctrl + enter;

Actual Results:
error502 in all cells of the selected range

Expected Results:
The selected range should display the elements of the inverse matrix

Reproducible: Always

User Profile Reset: No

Additional Info:
Build ID: 1:6.4.4-0ubuntu0.20.04.1
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: en-GB (en_GB.UTF-8); UI-Language: en-GB
Calc: threaded
Comment 1 Alan Matthews 2020-08-27 22:14:52 UTC
Created attachment 164776 [details]
Spresdsheet showing problem
Comment 2 BogdanB 2020-08-28 04:58:34 UTC
Confirm with

Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: ro-RO (ro_RO.UTF-8); UI-Language: en-US
Calc: threaded

I was using the wizards but now way of solving this.
Comment 3 Alan Matthews 2020-08-28 17:33:45 UTC
MINVERSE(range) does work if range is a solvable square mtrix but if the range is not then it returns Err502.
Comment 4 Laurent BP 2020-08-28 17:55:59 UTC
I do not understand the problem. You gave a matrix with a null determinant. So LibreOffice says that argument is not valid (Err502) when you try to invert it.

What would you expect more?

MINVERSE works fine with a valid matrix.
Comment 5 BogdanB 2020-08-28 18:13:13 UTC
Thank you Laurent, I never used this function, but found hard to use it for the first time. I found a bug as you see in the video. Calc is inserting more numbers in the data source than should be. I think it is a bug, but with a different title and problem.

Now, for Alan: I attached a video showing how this function is working for a square matrix (2*2,3*3,4*4, and so on). 

First select where the result will be. After that use the wizard. See the video.
Comment 6 BogdanB 2020-08-28 18:13:43 UTC
Created attachment 164825 [details]
video showing another bug and how this works
Comment 7 Laurent BP 2020-08-28 18:51:33 UTC
With Wizard, you do not need to make a selection. Just indicate the top left cell where to start the result matrix.
In this case, there is no bug.

I suggest to open a different bug report for this bug.
Comment 8 BogdanB 2020-08-28 19:20:57 UTC
I opened a new bug for that: https://bugs.documentfoundation.org/show_bug.cgi?id=136242