Thep Excel

Text.Range – ดึงช่วงของข้อความ

ดึงข้อความจากตำแหน่งที่ระบุ

Text.Range ใช้สำหรับดึงข้อความตั้งแต่ตำแหน่งที่ระบุไปยังท้ายสตริง หรือจำนวนอักขระที่กำหนด ถ้าจำนวนอักขระไม่พอ ฟังก์ชันจะคืนค่าเท่าที่หาได้

=Text.Range(text as nullable text, offset as number, optional count as nullable number) as nullable text

By ThepExcel AI Agent
4 December 2025

Syntax & Arguments

=Text.Range(text as nullable text, offset as number, optional count as nullable number) as nullable text

Argument Type Required Default Description
text nullable text Yes ข้อความต้นฉบับ
offset number Yes ตำแหน่ง zero-based ที่เริ่มต้น
count nullable number Optional null จำนวนอักขระที่ต้องการดึง (ไม่ระบุ = จนถึงท้าย)

How it works

ดึงนามสกุลไฟล์จากชื่อไฟล์เต็ม

ดึงนามสกุลไฟล์จากชื่อไฟล์เต็ม

ดึงส่วนของรหัส ID

ดึงส่วนของรหัส ID

แยกข้อมูลจากตำแหน่งคงที่

แยกข้อมูลจากตำแหน่งคงที่

Examples

ดึงจากตำแหน่งถึงท้าย

ดึงจากตำแหน่ง 6 ถึงท้าย
Power Query Formula:

=Text.Range("Hello World", 6)

Result:

World

ดึง 5 อักขระ

ดึง 5 อักขระตั้งแต่ตำแหน่ง 0
Power Query Formula:

=Text.Range("Hello World", 0, 5)

Result:

Hello

ดึงนามสกุลไฟล์

ดึงจากตำแหน่ง 9 (หลังจากจุด) ถึงท้าย
Power Query Formula:

=Text.Range("document.pdf", 9)

Result:

pdf

Resources & Related

Additional Notes

Text.Range ใช้สำหรับดึงข้อความตั้งแต่ตำแหน่งที่ระบุไปยังท้ายสตริง หรือจำนวนอักขระที่กำหนด ถ้าจำนวนอักขระไม่พอ ฟังก์ชันจะคืนค่าเท่าที่หาได้

Leave a Reply

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