# Google Sheets COVARIANCE.S Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/covariance.s-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The COVARIANCE.S function calculates the sample covariance between two data sets, indicating how they vary together.

```
COVARIANCE.S(data_y, data_x)
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the COVARIANCE.S you need in plain EnglishGenerate Formula

## Parameters

**`data_y`**:\
The range of cells that contains the dependent variable data for which you want to calculate the covariance.

**`data_x`**:\
The range of cells that contains the independent variable data that you want to compare against the dependent variable data in `data_y`.

## What is COVARIANCE.S?

The *COVARIANCE.S* function in Google Sheets is a statistical tool used to calculate the sample covariance between two sets of data. Covariance is a measure of how much two random variables change together, and it helps in understanding the relationship between the two variables. A positive covariance indicates that the two variables tend to increase or decrease together, while a negative covariance indicates that one variable tends to increase when the other decreases.

In simpler terms, COVARIANCE.S allows you to analyze the relationship between two datasets and see how they vary together.

## A Practical Example

Imagine you are analyzing the relationship between the hours studied and the scores achieved by students in an exam:

### Study Hours Table:

| StudentID | HoursStudied |
| - | - |
| 1 | 5 |
| 2 | 10 |
| 3 | 3 |
| 4 | 8 |
| 5 | 6 |

### Exam Scores Table:

| StudentID | ExamScore |
| - | - |
| 1 | 75 |
| 2 | 90 |
| 3 | 60 |
| 4 | 85 |
| 5 | 80 |

You want to find out if there is a relationship between the hours studied and the exam scores.

## COVARIANCE.S Formula

To achieve this, you would use the COVARIANCE.S function as follows:

```
=COVARIANCE.S(A2:A6, B2:B6)
```

In this formula:

- `A2:A6` is the range containing the HoursStudied data.
- `B2:B6` is the range containing the ExamScore data.

## Result of the Formula

When you apply the COVARIANCE.S formula to the data, it will return a numerical value representing the covariance between the two datasets. A positive value indicates that as the hours studied increase, the exam scores tend to increase as well.

## Why Use COVARIANCE.S?

COVARIANCE.S is beneficial because it provides insights into the relationship between two variables, which can be crucial for data analysis and decision-making. Understanding covariance can help in predicting outcomes and making informed choices based on historical data.

## Key Takeaways:

- **COVARIANCE.S**: A statistical function that calculates the sample covariance between two datasets.
- **Relationship Analysis**: Helps in understanding how two variables change together.
- **Positive and Negative Values**: Indicates the direction of the relationship between the datasets.
- **Common Use Cases**: Ideal for analyzing relationships in finance, education, and any scenario where understanding variable interactions is necessary.

COVARIANCE.S is an essential function for anyone working with data analysis in Google Sheets, providing a powerful way to enhance your understanding of variable relationships.

Happy analyzing!

## Example use case

You have a table with sales data in Column A (monthly sales) and Column B (monthly advertising spend). Use COVARIANCE.S to calculate the covariance between sales and advertising, helping you understand the relationship between marketing efforts and revenue.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Password Protect An Google Sheets File](https://betteranalyst.com/google-sheets/how-to-password-protect-an-google-sheets-file)
- [How To Remove Blank Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-blank-rows-in-google-sheets)
- [How To Remove Duplicates In Google Sheets](https://betteranalyst.com/google-sheets/how-to-remove-duplicates-in-google-sheets)
- [How To Separate Names In Google Sheets](https://betteranalyst.com/google-sheets/how-to-separate-names-in-google-sheets)
- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)
- [How To Strikethrough In Google Sheets](https://betteranalyst.com/google-sheets/how-to-strikethrough-in-google-sheets)
- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
