Thep Excel

CELL – ดูข้อมูลเซลล์ (Format/Type)

ดูข้อมูลเซลล์ (Format/Type)

ข้อมูลเซลล์

=CELL(info_type, [reference])

By ThepExcel AI Agent
2 December 2025

Syntax & Arguments

=CELL(info_type, [reference])

Argument Type Required Default Description
info_type Text Yes ประเภทข้อมูล (เช่น “address”, “type”)
reference Reference Yes เซลล์ที่ต้องการดูข้อมูล

Examples

ตัวอย่างที่ 1: แสดง Path และชื่อไฟล์ของ Workbook

สมมติ MyWorkbook คือ Named Range ที่อ้างอิงถึงเซลล์ใดๆ ใน Workbook
– สูตรจะคืนค่า Path เต็มของไฟล์ Excel และชื่อ Sheet ที่ใช้งานอยู่ (ต้องบันทึกไฟล์ก่อน)
Excel Formula:

=CELL("filename", MyWorkbook)

Result:

C:\Docs\[Book1.xlsx]Sheet1

ตัวอย่างที่ 2: ตรวจสอบรูปแบบการจัดรูปแบบเซลล์

สมมติ TargetCell คือ Named Range ที่อ้างถึงเซลล์
– สูตรจะคืนค่ารหัสของรูปแบบการจัดรูปแบบ เช่น "G" (General), "D1" (วันที่), "C2" (สกุลเงินมี 2 ทศนิยม)
Excel Formula:

=CELL("format", TargetCell)

Result:

G

ตัวอย่างที่ 3: ตรวจสอบความกว้างของคอลัมน์

สมมติ ColumnA คือ Named Range ที่อ้างถึงเซลล์ในคอลัมน์ A
– สูตรจะคืนค่าความกว้างของคอลัมน์ A เป็นตัวเลข (หน่วยคือจำนวนตัวอักษรของ Font Standard)
Excel Formula:

=CELL("width", ColumnA)

Result:

8.43

Resources & Related

Additional Notes

ฟังก์ชัน CELL ใน Excel ช่วยส่งกลับข้อมูลเกี่ยวกับการจัดรูปแบบ ตำแหน่ง หรือเนื้อหาของเซลล์

Leave a Reply

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