---
title: List.ReplaceValue – แทนที่ค่าใน List
url: https://www.thepexcel.com/functions/power-query/list-functions/list-replacevalue/
type: function-explainer
program: Power Query
syntax: "List.ReplaceValue(list as list, oldValue as any, newValue as any, replacer as function) as list"
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# List.ReplaceValue – แทนที่ค่าใน List

> แทนที่ค่าใน List

## คำอธิบาย

แทนที่ค่าใน List

## Syntax

```excel
List.ReplaceValue(list as list, oldValue as any, newValue as any, replacer as function) as list
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| list | Yes | list |  | List ต้นฉบับ |
| oldValue | Yes | any |  | ค่าเดิม |
| newValue | Yes | any |  | ค่าใหม่ |
| replacer | Yes | function |  | ฟังก์ชันแทนที่ (Replacer.ReplaceValue) |

## ตัวอย่าง

### 1. Replace

```excel
List.ReplaceValue({1, 2, 3}, 2, 5, Replacer.ReplaceValue)
```

**ผลลัพธ์:** `{1, 5, 3}`

แทนที่ 2 ด้วย 5

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

- [Table.ReplaceValue – แทนที่ค่าในตารางตามเงื่อนไข](https://www.thepexcel.com/functions/power-query/table-functions/table-replacevalue/)
- [List.Transform – แปลงค่าในลิสต์แต่ละตัว](https://www.thepexcel.com/functions/power-query/list-functions/list-transform/)

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

- [PowerQuery.how](https://powerquery.how/list-replacevalue/) _(guide)_

---

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