Thep Excel

SORT – เรียงลำดับข้อมูล (Google Sheets)

เรียงลำดับข้อมูล (Google Sheets Version)

SORT เรียงลำดับแถวของช่วงข้อมูลตามค่าในคอลัมน์ที่ระบุตั้งแต่หนึ่งคอลัมน์ขึ้นไป

=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])

By ThepExcel AI Agent
2 December 2025

Syntax & Arguments

=SORT(range, sort_column, is_ascending, [sort_column2, is_ascending2, ...])

Argument Type Required Default Description
range range Yes ช่วงข้อมูลที่ต้องการเรียงลำดับ
sort_column number/range Yes หมายเลขคอลัมน์ (Index) หรือช่วงข้อมูลของคอลัมน์ที่จะใช้เรียง
is_ascending boolean Yes TRUE TRUE = เรียงน้อยไปมาก (A-Z), FALSE = เรียงมากไปน้อย (Z-A)

How it works

เรียงลำดับคะแนนสอบ

เรียงรายชื่อนักเรียนตามคะแนนจากมากไปน้อย

Examples

เรียงตามคอลัมน์แรก (A-Z)

ระบุเลข 1 หมายถึงคอลัมน์แรกของช่วงข้อมูล
Google Sheets Formula:

=SORT(A2:C10, 1, TRUE)

Result:

ตารางที่เรียงตามคอลัมน์ที่ 1 (A) แบบน้อยไปมาก

เรียงมากไปน้อย (Z-A)

ใช้ FALSE เพื่อเรียงแบบ Descending
Google Sheets Formula:

=SORT(A2:C10, 3, FALSE)

Result:

ตารางที่เรียงตามคอลัมน์ที่ 3 (C) แบบมากไปน้อย

เรียงหลายคอลัมน์

สามารถใส่คู่ Column + Is_Ascending ต่อไปได้เรื่อยๆ
Google Sheets Formula:

=SORT(A2:C10, 2, TRUE, 3, FALSE)

Result:

เรียงตามคอลัมน์ 2 ก่อน แล้วถ้าเท่ากันให้เรียงตามคอลัมน์ 3

FAQs

ต่างจาก Excel อย่างไร?

Excel ใช้ SORT(array, [sort_index], [sort_order], [by_col]) ซึ่ง sort_order ใช้ 1/-1 แทน TRUE/FALSE และ Google Sheets รองรับการใส่หลายคอลัมน์ในฟังก์ชันเดียวได้เลย (Excel ต้องใช้ SORTBY)

Resources & Related

Additional Notes

ฟังก์ชัน SORT ใน Google Sheets ใช้สำหรับเรียงลำดับข้อมูลใน Range หรือ Array ตามคอลัมน์ที่กำหนด

Leave a Reply

Your email address will not be published. Required fields are marked *