---
title: Number.RandomBetween – สุ่มเลขในช่วง
url: https://www.thepexcel.com/functions/power-query/number-functions/number-randombetween/
type: function-explainer
program: Power Query
syntax: "Number.RandomBetween(bottom as any, top as any) as any"
date: 2025-12-03
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# Number.RandomBetween – สุ่มเลขในช่วง

> สุ่มเลขในช่วง

## คำอธิบาย

สุ่มตัวเลขระหว่างช่วงที่กำหนด

## Syntax

```excel
Number.RandomBetween(bottom as any, top as any) as any
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| bottom | Yes | number |  | ค่าต่ำสุด |
| top | Yes | number |  | ค่าสูงสุด |

## ตัวอย่าง

### 1. Random Range

```excel
Number.RandomBetween(1, 10)
```

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

สุ่มเลข 1-10

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

- [Number.Random – สุ่มเลข 0-1](https://www.thepexcel.com/functions/power-query/number-functions/number-random/)
- [List.Random – สร้างรายการตัวเลขสุ่ม](https://www.thepexcel.com/functions/power-query/list-functions/list-random/)

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

- [PowerQuery.how](https://powerquery.how/number-randombetween/) _(guide)_

---

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