---
title: HSTACK – ฟังก์ชันรวมข้อมูลแนวนอน
url: https://www.thepexcel.com/functions/excel/lookup-and-reference/hstack/
type: function-explainer
program: Excel
syntax: "=HSTACK(array1, [array2], ...)"
date: 2025-12-01
updated: 2025-12-17
scores:
  popularity: 7
  difficulty: 5
  usefulness: 8
---

# HSTACK – ฟังก์ชันรวมข้อมูลแนวนอน

> รวมข้อมูลจากหลายช่วงเข้าด้วยกันในแนวนอน

## คำอธิบาย

HSTACK เป็นฟังก์ชัน Dynamic Array ที่ใช้รวมข้อมูลจากหลายช่วงเข้าด้วยกันโดยนำมาเรียงต่อกันในแนวนอน (ต่อท้ายไปทางขวา) หากช่วงข้อมูลที่นำมารวมมีจำนวนแถวไม่เท่ากัน HSTACK จะเติมค่า #N/A ในส่วนที่ขาดหายไปให้โดยอัตโนมัติ

## Syntax

```excel
=HSTACK(array1, [array2], ...)
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| array1 | Yes | Range |  | ช่วงข้อมูลหรืออาร์เรย์แรกที่ต้องการนำมาตั้งต้น |
| array2 | No | Range | "" | ช่วงข้อมูลอื่นๆ ที่ต้องการนำมาต่อท้ายทางขวา (สูงสุด 253 ช่วง) |

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

### รวมคอลัมน์แยก

นำคอลัมน์ชื่อ (A) และคอลัมน์คะแนน (C) มารวมกันเป็นตารางใหม่ โดยข้ามคอลัมน์ B

### เพิ่มคอลัมน์คำนวณ

ใช้ HSTACK รวมข้อมูลดิบเข้ากับผลลัพธ์จากการคำนวณในสูตรเดียว

### สร้างตารางเปรียบเทียบ

นำข้อมูลยอดขายปีนี้และปีที่แล้วมาวางคู่กันเพื่อเปรียบเทียบ

## ตัวอย่าง

### 1. รวม 2 คอลัมน์

```excel
=HSTACK(Column1, Column2)
```

**ผลลัพธ์:** `ตารางใหม่ 2 คอลัมน์`

นำข้อมูลจาก Column1 และ Column2 มาเรียงต่อกันในแนวนอน

### 2. รวมช่วงข้อมูลและคำนวณ

```excel
=HSTACK(Sales_Data[Salesperson], Sales_Data[Region], Sales_Data[Amount] * 0.1)
```

**ผลลัพธ์:** `ตาราง Sales + Commission`

สร้างตารางใหม่ที่มีคอลัมน์ Sale_Data, Region และคอลัมน์ Commission (คำนวณ 10% ของ Amount)

### 3. รวมค่าคงที่และผลรวม

```excel
=HSTACK("Total Sales", SUM(Sales_Data[Amount]))
```

**ผลลัพธ์:** `Total Sales | [ยอดรวม]`

สร้างตารางแนวนอน 2 คอลัมน์ โดยคอลัมน์แรกเป็นข้อความ คอลัมน์ที่สองเป็นผลรวมยอดขาย

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

**Q: ถ้าจำนวนแถวไม่เท่ากันจะเป็นอย่างไร?**

HSTACK จะยึดตามช่วงที่มีแถวมากที่สุด และเติม #N/A ให้กับช่วงที่มีแถวน้อยกว่าในส่วนที่ขาดไป

**Q: ต่างจาก VSTACK อย่างไร?**

VSTACK เรียงข้อมูลลงด้านล่าง (แนวตั้ง) ส่วน HSTACK เรียงข้อมูลไปทางขวา (แนวนอน)

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

- [COLUMN – บอกเลขคอลัมน์](https://www.thepexcel.com/functions/excel/lookup-and-reference/column/)
- [COLUMNS – นับจำนวนคอลัมน์ทั้งหมด](https://www.thepexcel.com/functions/excel/lookup-and-reference/columns/)
- [EXPAND – ขยายขนาดตารางพร้อมเติมค่า (Padding)](https://www.thepexcel.com/functions/excel/lookup-and-reference/expand/)
- [HSTACK – ฟังก์ชันรวมข้อมูลแนวนอน](https://www.thepexcel.com/functions/excel/lookup-and-reference/hstack/)
- [LINEST – วิเคราะห์การถดถอยเชิงเส้น](https://www.thepexcel.com/functions/excel/statistical/linest/)
- [TOCOL – แปลงตาราง 2 มิติให้เป็นคอลัมน์เดียว](https://www.thepexcel.com/functions/excel/lookup-and-reference/tocol/)
- [TOROW – แปลงตาราง 2 มิติให้เป็นแถวเดียว](https://www.thepexcel.com/functions/excel/lookup-and-reference/torow/)
- [TRANSPOSE – กลับตาราง (Transpose)](https://www.thepexcel.com/functions/excel/lookup-and-reference/transpose/)
- [VSTACK – ฟังก์ชันรวมข้อมูลแนวตั้ง](https://www.thepexcel.com/functions/excel/lookup-and-reference/vstack/)

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

- [Microsoft Support: HSTACK function](https://support.microsoft.com/en-us/office/hstack-function-98c4ab76-10fe-4b4f-8d5f-af1c125fe8c2) _(Official Documentation)_
- [ExcelJet](https://exceljet.net/excel-functions/excel-hstack-function) _(guide)_

---

_Source: [https://www.thepexcel.com/functions/excel/lookup-and-reference/hstack/](https://www.thepexcel.com/functions/excel/lookup-and-reference/hstack/)_
