---
title: DCOUNT – นับจำนวน (ตัวเลข) จาก Database
url: https://www.thepexcel.com/functions/excel/database/dcount/
type: function-explainer
program: Excel
syntax: "=DCOUNT(database, field, criteria)"
date: 2025-12-02
updated: 2025-12-17
scores:
  popularity: 3
  difficulty: 5
  usefulness: 4
---

# DCOUNT – นับจำนวน (ตัวเลข) จาก Database

> นับจำนวน (ตัวเลข) จาก Database

## คำอธิบาย

นับจำนวนเซลล์ที่มีตัวเลขในฐานข้อมูลตามเงื่อนไข

## Syntax

```excel
=DCOUNT(database, field, criteria)
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| database | Yes | Range |  | ฐานข้อมูล |
| field | Yes | Text/Number |  | คอลัมน์ |
| criteria | Yes | Range |  | เงื่อนไข |

## ตัวอย่าง

### 1. นับจำนวนพนักงานตามแผนก

```excel
=DCOUNT(Database, "Age", Criteria_Range)
```

**ผลลัพธ์:** `จำนวนคน`

นับเฉพาะแถวที่ตรงตามเงื่อนไขใน Criteria_Range และมีข้อมูลในคอลัมน์ Age

### 2. เทียบกับ COUNTIFS

```excel
=COUNTIFS(Dept, "Sales", Age, ">30")
```

**ผลลัพธ์:** `เท่ากัน`

DCOUNT เหมาะกับการตั้งเงื่อนไขซับซ้อนๆ ในเซลล์แยกต่างหาก (Criteria Area)

### 3. นับจำนวนพนักงานตามแผนก

```excel
=DCOUNT(A1:D20, "Age", D22:D23)
```

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

Database: A1:D20 (ข้อมูลพนักงาน) นับจำนวนพนักงานจากแผนก "Sales" ที่มีข้อมูล Age = 15 คน

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

- [COUNT – ฟังก์ชันนับจำนวนตัวเลข](https://www.thepexcel.com/functions/excel/statistical/count/)
- [COUNTIF – นับจำนวนแบบมีเงื่อนไข](https://www.thepexcel.com/functions/excel/statistical/countif/)
- [COUNTIFS – ฟังก์ชันนับเซลล์ตามหลายเงื่อนไขพร้อมกัน](https://www.thepexcel.com/functions/excel/statistical/countifs/)
- [DCOUNTA – นับจำนวน (ไม่ว่าง) จาก Database](https://www.thepexcel.com/functions/excel/database/dcounta/)
- [SUBTOTAL – คำนวณผลรวมย่อยพร้อม Filter](https://www.thepexcel.com/functions/excel/math-and-trigonometry/subtotal/)

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

- [Official Documentation](https://support.microsoft.com/en-us/office/dcount-function-c1fc7b93-fb0d-4d8d-97db-8d5f076eaeb1) _(official)_
- [ExcelJet](https://exceljet.net/excel-functions/excel-dcount-function) _(guide)_

---

_Source: [https://www.thepexcel.com/functions/excel/database/dcount/](https://www.thepexcel.com/functions/excel/database/dcount/)_
