COVARIANCE Formula Excel

There are two ways to “covariance formula excel”: the quick way you copy and the durable way you understand. This page gives you both. The exact Excel answer is above; below, we build the small mental model that makes the fix stick, so the next variation of the same problem solves itself.

Exact answer

In Excel: use =COVARIANCE.S(array1, array2) for a sample — it measures whether two variables move together, in units that make the number hard to interpret alone.

On this page8

Syntax

=COVARIANCE.S(array1, array2)

Arguments

Argumentrequired / optionalDescription
array1requiredThe first set of values.
array2requiredThe second set, the same size as array1.

Related functions

CORRELVARSLOPE and INTERCEPT
▤Annotated stepsExcel
1

Select the result cell and type =COVARIANCE.S(.

2

Select the two equal-length ranges, separated by a comma.

3

Press Enter — then compute CORREL over the same ranges for an interpretable figure.

4

Keep covariance itself for portfolio maths, where the scale is the point.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

Covariance measures joint variability: positive when two variables rise together, negative when one rises as the other falls. Its weakness is scale — the result is in the product of the two variables' units, so a covariance of 4,200 means nothing without knowing what is being measured. That is exactly why CORREL exists, dividing covariance by the two standard deviations to produce a bounded -1 to 1 figure. Covariance earns its place in portfolio mathematics, where the covariance matrix, not the correlation matrix, is what combines into portfolio variance. COVARIANCE.S is the sample form; COVARIANCE.P assumes a full population. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. The difference between a quick fix and a sheet you can trust is the extra minute you spend validating “covariance formula excel”. Start on a copy or a tiny sample, keep the affected formula visible, and compare the result with the outcome you expected before you touch the real workbook. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. The point is a calculation you can defend to a CFO or an auditor, but the practical win is that someone else can open the file and understand what happened without asking you.

A worked example

Two return series in B2:B100 and C2:C100: =COVARIANCE.S(B2:B100, C2:C100) returning 0.0032 says they move together, but the size is uninterpretable on its own. Normalising it: =COVARIANCE.S(B,C)/(STDEV.S(B)*STDEV.S(C)) reproduces =CORREL(B,C) exactly, which is the figure to report. Covariance is the quantity portfolio maths runs on, and knowing it is uninterpretable alone is what keeps it out of reports. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “covariance formula excel”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Reporting a raw covariance, which is uninterpretable without the units; report the correlation instead.
  • Ranges of different lengths, which returns #N/A.
  • Using COVARIANCE.P on sample data, which understates the figure the same way VAR.P does.

Frequently asked questions

What is the difference between covariance and correlation?

Correlation is covariance divided by both standard deviations, which bounds it between -1 and 1 and makes it comparable across datasets.

Which should I report?

Correlation, nearly always. Covariance is for the maths, not the narrative.

When does covariance matter directly?

Portfolio variance, which combines covariances rather than correlations.