Bug 105512

Summary: CORREL() function cannot calculate correlation of a row and column, results in Err:502 / Invalid argument
Product: LibreOffice Reporter: Daniel Trebbien <dtrebbien>
Component: CalcAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: dtrebbien, miguelangelrv, xiscofauli
Priority: medium Keywords: needsDevAdvice
Version: 5.2.4.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Test case

Description Daniel Trebbien 2017-01-24 20:18:19 UTC
Created attachment 130666 [details]
Test case

The CORREL() function to calculate the correlation between two cell ranges should allow one of the ranges to be a range in one row, and the other to be a range in one column.  For example, =CORREL(A1:A5,B1:F1) should calculate the correlation between the five cells in column A at A1:A5 and the five cells in row 1 at B1:F1.

This is supported by Apple Numbers version 4.0.5 and Microsoft Excel 2000.
Comment 1 m_a_riosv 2017-01-25 00:24:32 UTC
Looks ODF definition daesn't allow that.
"
6.18.17
CORREL
Summary:
 Calculates the correlation coefficient of values in N1 and N2.
Syntax:
 CORREL( ForceArray Array N1 ; ForceArray Array N2 )
Returns:
 Number
Constraints:
 COLUMNS(N1) = COLUMNS(N2), ROWS(N1) = ROWS(N2), both sequences shall
contain at least one number at corresponding positions each.
Semantics:
 Has the same value as COVAR(N1;N2)/STDEVP(N1)*(STDEVP(N2)). The CORREL
function actually is identical to the PEARSON function.
For an empty element or an element of type Text or Boolean in 
N1  the element at the corresponding position of N2  is ignored, and vice versa
"
Perhaps could be an acceptable request for enhacement for compatibility reasons.

BTW can be solved using TRANSPOSE() function
=CORREL(A1:A5;TRANSPOSE(B1:F1))