-
-
Notifications
You must be signed in to change notification settings - Fork 0
List.Correlation
Rodrigo Celso de Lima Porto edited this page Jan 13, 2026
·
1 revision
Calculates the correlation coefficient between two lists of numeric values. Supports Pearson (linear) and Spearman (rank-based) correlation.
List.Correlation(
list1 as list,
list2 as list,
optional typeCorrelation as text
) as number-
list1: list of numeric values (nulls and non-numeric values are treated as 0). -
list2: list of numeric values (nulls and non-numeric values are treated as 0). -
typeCorrelation(optional): "Pearson" (default) or "Spearman". Case-insensitive.
A number representing the correlation coefficient:
- Pearson: standard Pearson correlation (linear relationship).
- Spearman: Spearman rank correlation (uses dense ranking; tied values receive the same rank).
- Input lists must be the same length; otherwise, an error is raised.
- Null, empty string, or non-numeric entries are converted to 0 before calculation.
- Result is returned as a decimal number (can be negative, positive, or
NaNif degenerate).
Example 1: Calculates the default Pearson Correlation.
List.Correlation({0, 1, 3, 4}, {4, 5, 10, 30})Result
0.858575902776297 (Pearson, default)Example 2: Calculates the Spearman (monotonic) Correlation if specified.
List.Correlation({0, 1, 3, 4}, {4, 5, 10, 30}, "Spearman")Result
1Example 3: Non-numeric values are treated as 0.
List.Correlation({0, null, 3, "a", 4}, {4, 5, null, 10, 30})Result
0.556720639738652- Binary.Unzip πβοΈ
- DateTime.ToUnixTime πβοΈ
- Decision.EntropyWeights πβοΈ
- Decision.TOPSIS πβοΈ
- List.Correlation πβοΈ
- List.Intercept πβοΈ
- List.Outliers πβοΈ
- List.PopulationStdDev πβοΈ
- List.Primes πβοΈ
- List.Rank πβοΈ
- List.Slope πβοΈ
- List.Variance πβοΈ
- List.WeightedAverage πβοΈ
- Number.FromRoman πβοΈ
- Number.IsInteger πβοΈ
- Number.IsPrime πβοΈ
- Number.ToRoman πβοΈ
- Statistical.NormDist πβοΈ
- Statistical.NormInv πβοΈ
- Table.AddColumnFromList πβοΈ
- Table.CorrelationMatrix πβοΈ
- Table.NormalizeColumnNames πβοΈ
- Table.NormalizeTextColumns πβοΈ
- Table.RemoveBlankColumns πβοΈ
- Table.TransposeCorrectly πβοΈ
- Text.CountChar πβοΈ
- Text.ExtractNumbers πβοΈ
- Text.HtmlToPlainText πβοΈ
- Text.RegexExtract πβοΈ
- Text.RegexReplace πβοΈ
- Text.RegexSplit πβοΈ
- Text.RegexTest πβοΈ
- Text.RemoveAccents πβοΈ
- Text.RemoveDoubleSpaces πβοΈ
- Text.RemoveLetters πβοΈ
- Text.RemoveNumerals πβοΈ
- Text.RemovePunctuations πβοΈ
- Text.RemoveStopwords πβοΈ
- Text.RemoveWeirdChars πβοΈ
- AreArraysEquals πβοΈ
- AutoFillFormulas πβοΈ
- CleanString πβοΈ
- DisableRefreshAll πβοΈ
- EnableRefreshAll πβοΈ
- FileExists πβοΈ
- FileNameIsValid πβοΈ
- GetAllFileNames πβοΈ
- GetLetters πβοΈ
- GetMonthNumberFromName πβοΈ
- GetStringBetween πβοΈ
- GetStringWithSubstringInArray πβοΈ
- GetTableColumnNames πβοΈ
- IsAllTrue πβοΈ
- IsInArray πβοΈ
- ListObjectExists πβοΈ
- PreviousMonthNumber πβοΈ
- RangeHasAnyFormula πβοΈ
- RangeHasConstantValues πβοΈ
- RangeIsHidden πβοΈ
- RangeToHtml πβοΈ
- SendEmail πβοΈ
- SetQueryFormula πβοΈ
- StringContains πβοΈ
- StringEndsWith πβοΈ
- StringStartsWith πβοΈ
- SubstringIsInArray πβοΈ
- Summation πβοΈ
- TableHasQuery πβοΈ
- WorksheetHasListObject πβοΈ