Thep Excel

Number.From – แปลงค่าเป็นตัวเลข

แปลงค่าใดๆ ให้เป็นตัวเลข (Number)

Number.From จะพยายามแปลงค่า Input ให้เป็น Number หากเป็น Text จะพยายาม Parse ตัวเลขออกมา หากเป็น Date/Time จะแปลงเป็น Serial Number (เช่นเดียวกับ Excel)

=Number.From(value as any, optional culture as nullable text) as nullable number

By ThepExcel AI Agent
3 December 2025

Syntax & Arguments

=Number.From(value as any, optional culture as nullable text) as nullable number

Argument Type Required Default Description
value any Yes ค่าที่ต้องการแปลงเป็นตัวเลข
culture text Optional null รหัสวัฒนธรรม (Culture Code) เช่น “en-US” หรือ “th-TH” (มีผลต่อการแปลทศนิยมและหลักพัน)

How it works

แปลงข้อความเป็นตัวเลข

แปลง "123.45" ให้เป็นตัวเลข 123.45 เพื่อนำไปคำนวณ

แปลงวันที่เป็น Serial Number

แปลงค่า Date ให้เป็นตัวเลข (เช่น 45658) เพื่อใช้ในการคำนวณทางคณิตศาสตร์

Examples

ตัวอย่างที่ 1: แปลงข้อความตัวเลข

แปลงข้อความ "123.45" เป็นตัวเลข
Power Query Formula:

=Number.From("123.45")

Result:

123.45

ตัวอย่างที่ 2: แปลงวันที่

แปลงวันที่เป็น Serial Number แบบ Excel
Power Query Formula:

=Number.From(#date(2020, 3, 20))

Result:

43910

ตัวอย่างที่ 3: ใช้ Culture

แปลงข้อความรูปแบบเยอรมัน (ใช้ . คั่นพัน และ , คั่นทศนิยม) ให้เป็นตัวเลขที่ถูกต้อง
Power Query Formula:

=Number.From("1.234,56", "de-DE")

Result:

1234.56

FAQs

Number.From ต่างจาก Number.FromText อย่างไร?

Number.FromText ใช้ได้เฉพาะกับ Text เท่านั้น แต่ Number.From ใช้กับค่าประเภทอื่นได้ด้วย (เช่น Date, Time, Logical)

Resources & Related

Additional Notes

ฟังก์ชัน Number.From ใน Power Query ใช้สำหรับแปลงค่าต่างๆ ให้เป็นชนิดข้อมูลตัวเลข (Number) รองรับการแปลงจากข้อความ (Text), วันที่, เวลา หรือค่าอื่นๆ

Leave a Reply

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