---
title: GAMMALN.PRECISE – หาค่า Log ธรรมชาติของ Gamma Function (แม่นยำ)
url: https://www.thepexcel.com/functions/excel/statistical/gammaln-precise/
type: function-explainer
program: Excel
syntax: =GAMMALN.PRECISE(x)
date: 2025-12-02
updated: 2025-12-24
scores:
  popularity: 5
  difficulty: 4
  usefulness: 6
---

# GAMMALN.PRECISE – หาค่า Log ธรรมชาติของ Gamma Function (แม่นยำ)

> GAMMALN.PRECISE ส่งกลับค่าลอการิทึมธรรมชาติของฟังก์ชัน Gamma โดยมีความแม่นยำสูงกว่า GAMMALN ปกติ

## คำอธิบาย

GAMMALN.PRECISE ส่งกลับค่าลอการิทึมธรรมชาติของฟังก์ชัน Gamma โดยมีความแม่นยำสูงกว่า GAMMALN ปกติ

## Syntax

```excel
=GAMMALN.PRECISE(x)
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| x | Yes | Number |  | ค่าตัวเลขที่ต้องการคำนวณลอการิทึมธรรมชาติของ Gamma function เป็นจำนวนจริงที่มากกว่า 0 |

## ตัวอย่าง

### 1. ตัวอย่างพื้นฐาน - ln(Γ(4))

```excel
=GAMMALN.PRECISE(4)
```

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

คำนวณลอการิทึมธรรมชาติของ Gamma(4) ผลลัพธ์คือ 1.7917595 ซึ่ง e^1.7917595 = 3! = 6 (เนื่องจาก Γ(n) = (n-1)! สำหรับจำนวนเต็มบวก)

### 2. ตัวอย่างในสถิติ - การคำนวณ Beta Distribution

```excel
=GAMMALN.PRECISE(2) + GAMMALN.PRECISE(3) - GAMMALN.PRECISE(5)
```

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

ใช้สำหรับคำนวณค่า log ของ Beta function B(a,b) = ln(Γ(a)) + ln(Γ(b)) - ln(Γ(a+b)) ซึ่งจำเป็นในการคำนวณ Beta distribution

### 3. ตัวอย่างกับทศนิยม - ln(Γ(0.5))

```excel
=GAMMALN.PRECISE(0.5)
```

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

สำหรับค่า 0.5 ผลลัพธ์คือ 0.5723649 ซึ่งเท่ากับ ln(√π) เนื่องจาก Γ(0.5) = √π = 1.7724539

### 4. ตัวอย่างการป้องกัน Overflow - แฟคทอเรียลของ 100

```excel
=EXP(GAMMALN.PRECISE(101))
```

**ผลลัพธ์:** `9.3326E+157`

ในการคำนวณ 100! โดยตรงจะเกิด overflow เพราะตัวเลขใหญ่มาก ใช้ GAMMALN.PRECISE ก่อนแล้วค่อย EXP ช่วยหลีกเลี่ยงปัญหา (Γ(101) = 100!)

## หมายเหตุเพิ่มเติม

- ใช้ GAMMALN.PRECISE แทน GAMMALN สำหรับความแม่นยำที่ดีกว่า โดยเฉพาะในการคำนวณทางสถิติ

- ในการป้องกัน overflow เมื่อคำนวณแฟคทอเรียลขนาดใหญ่ ให้ใช้ GAMMALN.PRECISE ก่อนแล้วค่อย EXP() แทนที่จะคำนวณโดยตรง

- เมื่อต้องการหา ln(n!) ให้ใช้ =GAMMALN.PRECISE(n+1) เพราะ GAMMALN.PRECISE(n) = ln((n-1)!)

- สำหรับการคำนวณ Beta function B(a,b) ให้ใช้สูตร =GAMMALN.PRECISE(a) + GAMMALN.PRECISE(b) - GAMMALN.PRECISE(a+b) แล้วใช้ EXP() หากต้องการค่าจริง

- เมื่อทำงานกับข้อมูลที่มีค่า x อยู่ในช่วงใหญ่ๆ GAMMALN.PRECISE จะเสถียร (stable) มากกว่า GAMMALN ปกติ

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

**Q: ต่างอะไรระหว่าง GAMMALN กับ GAMMALN.PRECISE?**

ทั้งสองฟังก์ชันทำงานเหมือนกัน แต่ GAMMALN.PRECISE มีความแม่นยำสูงกว่า (precision) โดยเฉพาะเมื่อค่า x มีขนาดเล็กหรือมีค่าทศนิยมจำนวนมาก ส่วนใหญ่ลำเอียงไปใช้ GAMMALN.PRECISE

**Q: ตัวเลขลบเข้าได้ไหม?**

ไม่ได้ ฟังก์ชัน Gamma ไม่นิยามสำหรับจำนวนศูนย์และจำนวนลบ หากใส่ค่าเป็นศูนย์หรือลบ จะได้ #NUM! error

**Q: ใช้สำหรับอะไรในโลกความเป็นจริง?**

ส่วนใหญ่ใช้ในสถิติขั้นสูง เช่น Beta distribution, Gamma distribution, Poisson regression และ Maximum Likelihood Estimation (MLE)

**Q: ทำไมถึงใช้ Logarithm?**

เพราะแฟคทอเรียล (factorial) ของตัวเลขใหญ่ๆ เป็นค่าที่ใหญ่มากเกินไป (overflow) การใช้ logarithm ช่วยให้จัดการตัวเลขได้ง่ายและแม่นยำกว่า รวมถึงอำนวยความสะดวกในการคำนวณเชิงสถิติ

**Q: สูตรทางคณิตศาสตร์คืออะไร?**

GAMMALN.PRECISE(x) = ln(Γ(x)) โดย Γ(x) = ∫[0 to ∞] t^(x-1) * e^(-t) dt และสำหรับจำนวนเต็มบวก Γ(n) = (n-1)!

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

- [GAMMA – คำนวณค่า Gamma Function](https://www.thepexcel.com/functions/excel/statistical/gamma/)
- [GAMMALN – หาค่า Log Gamma](https://www.thepexcel.com/functions/excel/statistical/gammaln/)
- [LN – หาค่า Natural Logarithm (ลอการิทึมธรรมชาติ)](https://www.thepexcel.com/functions/excel/math-and-trigonometry/ln/)
- [SQRT – ถอดรากที่สอง](https://www.thepexcel.com/functions/excel/math-and-trigonometry/sqrt/)

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

- [Microsoft Excel - GAMMALN.PRECISE Documentation](https://support.microsoft.com/en-us/office/gammaln-precise-function-5cdfe601-4e1e-4189-9d74-241ef1caa599) _(official)_
- [Wikipedia - Gamma Function](https://en.wikipedia.org/wiki/Gamma_function) _(article)_
- [Beta Distribution and Gamma Function in Statistics](https://en.wikipedia.org/wiki/Beta_distribution) _(article)_

---

_Source: [https://www.thepexcel.com/functions/excel/statistical/gammaln-precise/](https://www.thepexcel.com/functions/excel/statistical/gammaln-precise/)_
