---
title: List.Covariance – คำนวณความแปรปรวนร่วมระหว่างสอง List
url: https://www.thepexcel.com/functions/power-query/list-functions/list-covariance/
type: function-explainer
program: Power Query
syntax: "List.Covariance(numberList1 as list, numberList2 as list) as nullable number"
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 4
  usefulness: 5
---

# List.Covariance – คำนวณความแปรปรวนร่วมระหว่างสอง List

> คำนวณ Covariance ของสอง List

## คำอธิบาย

List.Covariance คืนค่าความแปรปรวนร่วมของตัวเลขสองชุดใน List เพื่อดูความสัมพันธ์เชิงทิศทาง

## Syntax

```excel
List.Covariance(numberList1 as list, numberList2 as list) as nullable number
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| numberList1 | Yes | list |  | List ของตัวเลขชุดแรก |
| numberList2 | Yes | list |  | List ของตัวเลขชุดที่สอง ต้องมีจำนวนสมาชิกเท่ากับ numberList1 |

## เคสการใช้งาน

### วิเคราะห์ความสัมพันธ์ระหว่างตัวแปร

ใช้เพื่อวิเคราะห์ว่าตัวแปรสองตัว (เช่น ยอดขายและค่าโฆษณา) มีความสัมพันธ์เชิงบวกหรือลบกันอย่างไร

### การวิเคราะห์ทางการเงิน

คำนวณ Covariance ของผลตอบแทนสินทรัพย์สองชนิดเพื่อประเมินความเสี่ยงของ Portfolio

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: Covariance ของ List ที่มีค่าเท่ากัน

```excel
List.Covariance({1, 2, 3}, {1, 2, 3})
```

**ผลลัพธ์:** `0.66666666666666607`

คำนวณความแปรปรวนร่วมของสอง List ที่มีรูปแบบการเปลี่ยนแปลงเหมือนกัน (สัมพันธ์กันโดยตรง)

### 2. ตัวอย่างที่ 2: Covariance ของ List ที่สัมพันธ์กันแบบตรงข้าม

```excel
List.Covariance({1, 2, 3}, {3, 2, 1})
```

**ผลลัพธ์:** `-0.66666666666666607`

List ทั้งสองมีความสัมพันธ์กันแบบตรงข้าม (ถ้าตัวหนึ่งเพิ่ม อีกตัวลด) ค่า Covariance จึงเป็นลบ

### 3. ตัวอย่างที่ 3: Covariance ของ List ที่ไม่มีความสัมพันธ์

```excel
List.Covariance({1, 2, 3}, {1, 3, 2})
```

**ผลลัพธ์:** `0`

List ทั้งสองไม่มีรูปแบบความสัมพันธ์ที่ชัดเจน ค่า Covariance จึงใกล้เคียงหรือเท่ากับศูนย์

## คำถามที่พบบ่อย

**Q: List ทั้งสองต้องมีชนิดข้อมูลเป็นตัวเลขเท่านั้นหรือไม่?**

ใช่ ฟังก์ชันนี้ถูกออกแบบมาเพื่อคำนวณกับ List ของตัวเลขเท่านั้น หากมีข้อมูลชนิดอื่นจะเกิด Error

**Q: List ทั้งสองต้องมีจำนวนสมาชิกเท่ากันหรือไม่?**

ใช่ จำนวนสมาชิกใน numberList1 และ numberList2 ต้องเท่ากัน มิฉะนั้นจะเกิด Error

## ฟังก์ชันที่เกี่ยวข้อง

- [List.Average – คำนวณค่าเฉลี่ยของรายการ](https://www.thepexcel.com/functions/power-query/list-functions/list-average/)
- [List.Sum – รวมค่าตัวเลขในรายการ](https://www.thepexcel.com/functions/power-query/list-functions/list-sum/)
- [List.StandardDeviation – คำนวณส่วนเบี่ยงเบนมาตรฐาน](https://www.thepexcel.com/functions/power-query/list-functions/list-standarddeviation/)

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: List.Covariance](https://learn.microsoft.com/en-us/powerquery-m/list-covariance) _(Official Documentation)_

---

_Source: [https://www.thepexcel.com/functions/power-query/list-functions/list-covariance/](https://www.thepexcel.com/functions/power-query/list-functions/list-covariance/)_
