---
title: List.AllTrue – ตรวจสอบว่าสมาชิกทุกตัวเป็น True
url: https://www.thepexcel.com/functions/power-query/list-functions/list-alltrue/
type: function-explainer
program: Power Query
syntax: List.AllTrue(list as list) as logical
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 4
  difficulty: 3
  usefulness: 4
---

# List.AllTrue – ตรวจสอบว่าสมาชิกทุกตัวเป็น True

> ตรวจสอบว่าทุกสมาชิกใน List เป็น True

## คำอธิบาย

List.AllTrue คืนค่า true หากทุกเงื่อนไขใน List เป็นจริงทั้งหมด

## Syntax

```excel
List.AllTrue(list as list) as logical
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| list | Yes | list |  | List ของค่าตรรกะ (logical values) หรือการแสดงออกที่คืนค่าเป็น true/false |

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

### ตรวจสอบสถานะทั้งหมด

ใช้ตรวจสอบว่าทุกสถานะใน List เป็น 'Completed' หรือ 'Valid' ทั้งหมดหรือไม่

### ยืนยันเงื่อนไขหลายข้อพร้อมกัน

ตรวจสอบว่าเงื่อนไขหลายข้อที่ซับซ้อน (เช่น การตรวจสอบข้อมูลจากหลายคอลัมน์) เป็นจริงทั้งหมดหรือไม่

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: ทุกเงื่อนไขเป็นจริง

```excel
List.AllTrue({true, true, 2 > 0})
```

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

ใน List `{true, true, 2 > 0}` ทุกองค์ประกอบเป็นจริง (2 > 0 คือ true) ดังนั้นฟังก์ชันจึงคืนค่าเป็น true

### 2. ตัวอย่างที่ 2: มีเงื่อนไขที่เป็น False

```excel
List.AllTrue({true, false, 2 < 0})
```

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

ใน List `{true, false, 2 < 0}` มีองค์ประกอบที่เป็น false อย่างน้อยหนึ่งตัว (false และ 2 < 0 คือ false) ดังนั้นฟังก์ชันจึงคืนค่าเป็น false

### 3. ตัวอย่างที่ 3: List ว่างเปล่า

```excel
List.AllTrue({})
```

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

List ว่างเปล่าจะถูกพิจารณาว่าไม่มีองค์ประกอบใดเป็น false ดังนั้นจึงคืนค่าเป็น true เสมอ

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

**Q: List.AllTrue แตกต่างจาก List.MatchesAll อย่างไร?**

List.AllTrue ใช้ตรวจสอบเฉพาะค่าตรรกะ (true/false) เท่านั้น ในขณะที่ List.MatchesAll ใช้ตรวจสอบเงื่อนไขที่ซับซ้อนกว่าโดยใช้ฟังก์ชัน predicate (เช่น ตรวจสอบว่าตัวเลขทุกตัวมากกว่า 0 หรือไม่)

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

- [List.Contains – ตรวจสอบว่า List มีสมาชิกที่กำหนดหรือไม่](https://www.thepexcel.com/functions/power-query/list-functions/list-contains/)
- [List.ContainsAll – ตรวจสอบว่า List มีสมาชิกทั้งหมดจากอีก List หรือไม่](https://www.thepexcel.com/functions/power-query/list-functions/list-containsall/)
- [List.AnyTrue – ตรวจสอบว่ามีสมาชิกบางตัวเป็น True](https://www.thepexcel.com/functions/power-query/list-functions/list-anytrue/)
- [List.Select – เลือกสมาชิกจาก List ตามเงื่อนไข](https://www.thepexcel.com/functions/power-query/list-functions/list-select/)
- [List.MatchesAll – ตรวจสอบว่าสมาชิกทุกตัวตรงตามเงื่อนไขหรือไม่](https://www.thepexcel.com/functions/power-query/list-functions/list-matchesall/)

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

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

---

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