Ravindra BagaleCourses & study guides मराठी Track your progress

30. Statistics for Analysts

30.4 CORREL and a Correlation Matrix: Which Numbers Move Together

Example first. Amir runs a Nashik dark store. For 20 days in September he has ad spend, discount, rain, orders and average delivery minutes. He asks: "Does ad spend go with more orders?" =CORREL(B2:B21,E2:E21) returns 0.891, a very strong positive link. Then he notices that delivery minutes and orders have a correlation of -0.60: do slow deliveries scare customers away? Not necessarily. Rain makes deliveries slow and keeps orders down. This lesson builds the full correlation matrix and teaches how to read it without fooling yourself.

Correlation — in 30 seconds

What: The correlation coefficient r (CORREL or PEARSON) measures how closely two columns move together in a straight line. It goes from −1 (perfect opposite) through 0 (no straight-line link) to +1 (perfect together).

Why: It is the quickest way to find which measures are linked before you build a regression or a dashboard, and to spot hidden third factors like rain.

Tiny example: =CORREL(B2:B21,E2:E21) returns 0.891 for ad spend and orders. Squared (=RSQ(E2:E21,B2:B21)) it is 0.793: a straight line on ad spend explains about 79% of the ups and downs in orders.

First look at the data (before → after):

Correlation: before and after tables, fictional Blinkit Maharashtra data

Expected result — Correlation with Orders

Column r Reading
AdSpend 0.89 positive very strong
Discount 0.91 positive very strong
Rain -0.76 negative strong
Mins -0.60 negative strong
Before table and formula as text

Before — Days (first 4 of 20, Nashik)

Date AdSpend Rain Orders Mins
1 Sep 2026 5 0 301 12.9
2 Sep 2026 8 2 335 12.3
3 Sep 2026 6 15 283 14.5
4 Sep 2026 10 0 381 13.7

Formula / click path

=CORREL(B2:B21,E2:E21)
=RSQ(E2:E21,B2:B21)
Data › Data Analysis › Correlation › Input Range B1:F21, Labels in first row

Do it step by step:

  1. Put the 20 days in A1:F21 with the headers Date, AdSpend, Discount, Rain, Orders and Mins.
  2. In H2 type =CORREL(B2:B21,E2:E21). Result 0.891: ad spend and orders rise together.
  3. Select Data › Data Analysis › Correlation, Input Range B1:F21, tick Labels in first row, Output Range H4, then OK.
  4. Read the lower triangle of the matrix: each cell is CORREL of its row and column.
  5. Select the numbers and add Home › Conditional Formatting › Color Scales so strong links stand out.
  6. For each strong pair, ask "could a third factor drive both?" before you write a conclusion.

The data: 20 days at a Nashik dark store (fictional)

Date AdSpend (₹000) Discount % Rain mm Orders Mins
1 Sep 2026 5 5 0 301 12.9
2 Sep 2026 8 10 2 335 12.3
3 Sep 2026 6 5 15 283 14.5
4 Sep 2026 10 10 0 381 13.7
5 Sep 2026 12 15 0 407 12.8
6 Sep 2026 7 5 30 251 16.4
7 Sep 2026 9 10 5 353 12.7
8 Sep 2026 15 15 0 453 13.4
9 Sep 2026 11 10 12 352 14.8
10 Sep 2026 6 5 0 308 12.2
11 Sep 2026 13 15 0 420 13.3
12 Sep 2026 8 5 25 293 15.0
13 Sep 2026 14 10 3 403 14.1
14 Sep 2026 10 10 0 375 12.5
15 Sep 2026 7 5 40 235 17.3
16 Sep 2026 12 15 0 419 13.0
17 Sep 2026 9 10 8 343 14.2
18 Sep 2026 16 15 0 448 12.6
19 Sep 2026 11 5 20 334 15.3
20 Sep 2026 13 10 6 388 14.1

The correlation matrix (ToolPak output, rounded to 2 decimals)

AdSpend Discount Rain Orders Mins
AdSpend 1.00 — — — —
Discount 0.81 1.00 — — —
Rain -0.41 -0.64 1.00 — —
Orders 0.89 0.91 -0.76 1.00 —
Mins -0.22 -0.52 0.93 -0.60 1.00

The ToolPak fills only the lower triangle, because CORREL(A,B) equals CORREL(B,A), and the diagonal is always 1. Every cell equals a CORREL formula, for example Rain and Mins: =CORREL(D2:D21,F2:F21) = 0.928.

A matrix with formulas that update. The ToolPak table is static. For a live matrix, put the five names in H12:L12 and H13:H17 and type this in I13, then fill it across and down to M17:

=CORREL(INDEX($B$2:$F$21,0,ROWS($1:1)),INDEX($B$2:$F$21,0,COLUMNS($A:A)))

INDEX(range,0,n) returns the whole n-th column, and ROWS / COLUMNS count 1, 2, 3… as you fill. In Microsoft 365 you can also spill the whole matrix from one cell: =MAKEARRAY(5,5,LAMBDA(r,c,CORREL(CHOOSECOLS(B2:F21,r),CHOOSECOLS(B2:F21,c)))) (lesson 9.18 explains LAMBDA).

How to read r

Size of r (ABS(r)) Common reading in business data Example from this matrix
0.8 to 1.0 Very strong AdSpend and Orders 0.89, Rain and Mins 0.93
0.6 to 0.8 Strong Rain and Orders -0.76, Discount and Rain -0.64
0.4 to 0.6 Moderate Discount and Mins -0.52
0.2 to 0.4 Weak AdSpend and Mins -0.22
below 0.2 Very weak or none —

These labels are a rule of thumb, not a law. With only 20 rows, an r of 0.3 can easily appear by chance; with 2,000 rows it is a real (but small) link.

Correlation is not causation: the rain trap. Mins and Orders have r = -0.60. It is tempting to write "slow delivery reduces orders". But Rain is strongly linked to both: rain slows riders (r = 0.93) and keeps orders down (r = -0.76). Rain is a confounder. Lesson 30.6 shows how a regression with Rain in it separates the effects. Also notice that AdSpend and Discount are themselves strongly linked (r = 0.81): on campaign days Amir raised both, so this data alone cannot fully separate their effects.

Three more checks before trusting r

  1. Draw it. Select B1:B21 and E1:E21 (hold Ctrl), choose Insert › Insert Scatter (X, Y) or Bubble Chart › Scatter, then Chart Design › Add Chart Element › Trendline › Linear. In Format Trendline tick Display R-squared value on chart: it shows 0.7931, the same as RSQ.
  2. r only measures straight lines. A U-shaped link (orders fall with very low and very high discounts) can have r near 0.
  3. One outlier can create or hide a correlation. Recalculate r without the extreme row and see if it holds.

Every number on this page was computed with Excel's documented formulas and re-checked twice: in LibreOffice Calc 25.2 with the same formulas, and in Python with scipy and statsmodels.

Microsoft sources (checked 7 October 2026): Use the Analysis ToolPak to perform complex data analysis; CORREL function.

Practice task (try it before you open the answer):

  1. What is the correlation between Discount and Orders, and how would you describe it?
  2. Which pair in the matrix has the strongest negative correlation?
  3. Write one honest sentence about Mins and Orders for a report.
Answer
  1. =CORREL(C2:C21,E2:E21) = 0.909: a very strong positive correlation.
  2. Rain and Orders, r = -0.76.
  3. For example: "Slower days had fewer orders (r = -0.60), but both happened on rainy days, so this data does not show that slow delivery itself reduced orders."

Ravindra Bagale's Tip

Every time you write "X drives Y" from a correlation, stop and name one possible third factor. If you can name one, write "goes together with" instead of "drives".

Loading practice tasks...

  1. Spend vs orders (Easy): Correlation of B2:B9 and D2:D9, rounded to 3 decimals.
  2. Spend vs visitors (Easy): Correlation of B2:B9 and C2:C9, rounded to 3 decimals.
  3. Visitors vs orders (Easy): Correlation of C2:C9 and D2:D9, rounded to 3 decimals.
  4. Spend vs returns (Medium): Correlation of B2:B9 and E2:E9, rounded to 3 decimals.
  5. Negative link? (Medium): Is the correlation of B2:B9 and E2:E9 below 0? (TRUE or FALSE)
  6. Strong link? (Medium): Is the size of the correlation of C2:C9 and D2:D9 above 0.8? (TRUE or FALSE)
  7. R squared (Medium): Correlation of B2:B9 and D2:D9, squared, rounded to 3 decimals.
  8. Same with RSQ (Hard): R squared of orders D2:D9 on spend B2:B9, rounded to 3 decimals.
  9. Covariance (Hard): Sample covariance of B2:B9 and D2:D9, rounded to 1 decimal.
  10. Order rate vs spend (Hard): Correlation of spend B2:B9 with orders ÷ visitors, rounded to 3 decimals.