ThepExcel Logo
  • บทความ
    • Excel
      • Excel ทั่วไป
      • Excel Pivot Table
      • Excel Power Pivot
      • Power Query
      • Excel Array Formula
      • Excel VBA
      • Excel for Business
      • Excel and Maths
      • ฟังก์ชัน Excel ทั้งหมด
    • Power BI
      • Power Query
      • Data Model
      • DAX Formula
      • Power BI Report
    • Coding
      • Excel VBA
      • Python
      • Power Query M Code
    • Highlights : บทความแนะนำ
    • คลิปวีดีโอ
  • อบรม
    • อบรมลูกค้าองค์กร
    • คอร์สออนไลน์ SkillLane
    • แนะนำวิทยากร
    • Excel/Power BI Skill Map
    • Quiz
  • Shop
    • คอร์สออนไลน์
    • สินค้าทั้งหมด
    • หนังสือเล่ม
    • E-Book
    • Cart
  • Download
    • Download ไฟล์จากเทพเอ็กเซล
    • ThepExcel-Mfx : M Code สำเร็จรูป
    • Date Table สำเร็จรูป
    • กราฟ My Skill
    • github.com/ThepExcel
  • รวม Link
    • รวม Link สอน Excel & Power BI ทั้งไทยและเทศ
    • รวม Link สอน Python / Programming
    • หนังสือแนะนำ
    • Facebook ThepExcel
    • YouTube ThepExcel
    • DAX Formatter
  • Contact
    • แนะนำ เทพเอ็กเซล (Thep Excel)
    • แนะนำวิทยากร : อาจารย์ ศิระ เอกบุตร (ระ)
    • นโยบายการคุ้มครองข้อมูลส่วนบุคคล (Privacy Policy)
  • Facebook
  • YouTube

ประเภทข้อมูล (Data Type) ในโปรแกรม Excel

Categories 📂

Excel ทั่วไป

Tags 🏷️

data, format, type, youtube

สารบัญ

  • ประเภทข้อมูล 4 แบบ
  • วิธีตรวจสอบประเภทข้อมูล
    • ใช้ยางลบ Clear Format ทิ้งแล้วดูด้วยตา
    • ใช้ Function =TYPE(ช่องที่ต้องการตรวจสอบ) 
    • ใช้ฟังก์ชั่นกลุ่ม IS….
  • ทำไมเราต้องเรียนรู้ประเภทของข้อมูลใน Excel?

ประเภทข้อมูล 4 แบบ

ใน Excel ไม่ว่าเราจะเขียนสูตร หรือ พิมพ์ข้อมูลลงไปใน Cell …. ผลลัพธ์ค่าที่แท้จริง (Value) สามารถแบ่งออกเป็น 4 ประเภทข้อมูลใหญ่ๆ ด้วยกัน คือ

ประเภทข้อมูล
  1. Number ตัวเลข สามารถเอามาคำนวณทางคณิตศาสตร์ได้
    • ตัวเลขปกติทั่วไป 10, 2.3, 1/2, 1.234E+03
    • ตัวที่อาจไม่เหมือนตัวเลข แต่จริงๆเป็นตัวเลขอย่าง เช่น วันที่และเวลา คือ ตัวเลขที่เปลี่ยน Format ไป
      • วันที่ เช่น 31 Jan 2013
        • Excel จะมองวันที่ เป็นจำนวนเต็ม เช่น
        • เลข 1 คือ วันที่ 1 เดือน 1 ปี คศ. 1900
        • เลข 2 คือ วันที่ 2 เดือน 1 ปี คศ. 1900
      • เวลา เช่น 16:30
        • Excel จะมองเวลา เป็นจุดทศนิยม โดย เที่ยงวันคือ 0.5 เป็นต้น
      • รายละเอียด อ่านได้ที่ การทำงานเกี่ยวกับวันและเวลา (Date & Time) ใน Excel
    • ธรรมชาติจะอยู่ ชิดขวาของ Cell โดยอัตโนมัติ
  2. Text ตัวอักษร เอาไว้แสดงผลข้อความ ไม่ได้เอาไว้มาคำนวณ
    • ตัวหนังสือจริงๆ เช่น ช้าง, ม้า, cow, sid110, I love my pen
    • ตัวหนังสือที่หน้าตาเหมือน Type อื่น เช่น 123 จริงๆ สามารถเป็นตัวหนังสือก็ได้ ถ้าพิมพ์ว่า ‘123
    • ธรรมชาติจะอยู่ ชิดซ้ายของ Cell โดยอัตโนมัติ
    • แปลว่า บางช่องเราอาจเห็นว่าเป็นตัวเลข แต่จริงๆ เป็น Text ก็ได้ วิธีดูคร่าวๆ คือ หากมันถูกจัดชิดซ้าย โดยที่เราไม่ได้ไปเป็นคนกำหนดจัดซ้ายเอง มันจะเป็น Text, ถ้าชิดขวาจะเป็นตัวเลข)
    • เราสามารถกำหนดให้เวลาพิมพ์ข้อมูลลงไป แล้วบังคับให้ผลลัพธ์เป็น Text ได้ โดย
      • วิธีที่ 1 : ใส่เครื่องหมาย ‘ นำหน้า เช่น ‘001234 มันจะออกมาเป็น 001234 ที่เป็น Text
      • วิธีที่ 2 : เปลี่ยน format ของ Cell เป็น Text ก่อน แล้วค่อยพิมพ์ข้อมูล
  3. Logic ตรรกะ มีอยู่ 2 อย่างคือ
    • TRUE เกิิดเมื่อมีการเปรียบเทียบค่าแล้วเป็นจริง เช่น ใส่สูตรว่า =10>3
    • FALSE เกิิดเมื่อมีการเปรียบเทียบค่าแล้วเป็นเท็จ เช่น ใส่สูตรว่า =5<2
    • ธรรมชาติจะอยู่ กึ่งกลางของ Cell โดยอัตโนมัติ
  4. Error ข้อผิดพลาด
    • ธรรมชาติจะอยู่ กึ่งกลางของ Cell โดยอัตโนมัติ
    • ความผิดพลาดมีหลายสาเหตุด้วยกัน การที่เรารู้ความแตกต่างของมัน จะทำให้เราเข้าใจ และแก้ไขข้อบกพร่องได้อย่างถูกต้องมากขึ้นครับ
ประเภท Errorความหมายค่าทดสอบที่แสดงออกมาจากการใช้ฟังก์ชัน
ERROR.TYPE
#NULL! เกิดจากการใช้ Intersection Operator (ช่องว่าง) แล้วปรากฎว่าการ Intersect นั้นออกมาเป็น Set ว่าง เช่น =SUM(A10:A20 C10:C20) (ช่วง 2 อันไม่มีช่องซ้ำกันเลย)1
#DIV/0!เกิดจากการคำนวณที่มีการหารด้วย 02
#VALUE!เกิดจากการใส่ค่า Input ลงไปในสูตรผิดประเภทข้อมูล
เช่น =IF(“แมว”,1,0) จะผิด เพราะ ตรง “แมว” จริงๆ ต้องเป็นตรรกกะ ที่ถูกคือ = IF(A3=”แมว”,1,0) จึงจะไม่ Error
3
#REF!เกิดจากการที่ไม่สามารถอ้างถึง Cell ได้ ซึ่งอาจเกิดจากการ Delete Cell, Column หรือ Row ไปจนช่องนั้นหายไป4
#NAME?มีการอ้างถึงชื่อ Cell หรือ Function ที่ไม่มีอยู่จริง (ปกติมักจะเกิดจากการจะใส่ข้อความ แต่ลืมใส่ ” ” ครอบ)5
#NUM!มีการใส่ค่าตัวเลขที่มากเกินกว่า Excel จะรับไหว หรือ อาจเกิดจากการที่ Excel ทำการคำนวณ Trial & Error ค่า (Iterative) แล้วไม่ได้ผลลัพธ์ที่ต้องการ เช่น ตอนใช้สูตร IRR6
#N/Aเป็น Error ที่เจอบ่อยมาก เช่น หาข้อมูลด้วยการ Lookup ไม่เจอ, อาจเกิดจากใส่ Input ลงสูตรผิดหรือเกิน (ซึ่งการ Lookup ไม่เจอ ไม่ใช่แปลว่าเขียนสูตรผิด)7
#GETTING_DATA8

วิธีตรวจสอบประเภทข้อมูล

โดยเราสามารถตรวจสอบว่าข้อมูลที่เราสนใจอยู่ในประเภทไหนได้ง่ายๆ มี 3 วิธี คือ

ใช้ยางลบ Clear Format ทิ้งแล้วดูด้วยตา

  • หากเป็น Number จะอยู่ชิดขวาของช่อง
  • หากเป็น Text ปกติจะอยู่ชิดซ้ายของช่อง
  • หากเป็น Logic จะเป็นคำว่า TRUE FALSE อยู่กึ่งกลางช่อง
  • หากเป็น Error มักมีเครื่องหมาย # หรือ ! และ อยู่กึ่งกลางช่อง

ใช้ Function =TYPE(ช่องที่ต้องการตรวจสอบ) 

ผลลัพธ์ที่ออกมาจะเป็นรหัสตัวเลข ซึ่งมีความหมายดังนี้

  • 1 = Number (ตัวเลข)
  • 2 = Text (ตัวอักษร)
  • 4 = Logic (ตรรกกะ) :
  • 16 = Error (ผิดพลาด)
  • 64 = Array (อาเรย์) **** เป็นการใส่ข้อมูลหลายๆ ค่าใน Cell เดียว ซึ่งขอไม่พูดถึึง ณ ตอนนี้ครับ

ใช้ฟังก์ชั่นกลุ่ม IS….

เป็นการถามคำถามกับ Excel ว่าใช้ประเภทข้อมูลที่สนใจมั้ย? ซึ่งจะให้ผลลัพธ์เป็น TRUE/FALSE

  • ISNUMBER เช็คว่า ใช่ตัวเลขหรือไม่?
  • ISTEXT เช็คว่า ใช่ตัวเลขหรือไม่?
  • ISNONTEXT เช็คว่า ไม่ใช่ตัวหนังสือหรือไม่?
  • ISLOGICAL เช็คว่า ใช่ตรรกกะหรือไม่?
  • ISERROR  เช็คว่า error หรือไม่?
  • ISFORMULA  เช็คว่า ใช่สูตรหรือไม่?

ทำไมเราต้องเรียนรู้ประเภทของข้อมูลใน Excel?

  • หากเรารู้ว่าข้อมูลที่เรากำลังใส่เป็นข้อมูลแบบไหน เราจะสามารถใช้สูตรได้พลิกแพลงมากขึ้น โดยเรารู้ว่าเราต้องใส่ Input ลงไปในสูตรในแต่ละ Argument (แต่ละช่อง Input) ให้ถูกประเภท ตามที่แต่ละสูตรต้องการ เช่น
    excel formula arguement
    • สูตร =LEFT(ข้อความ,จำนวนตัวอักษรที่ต้องการ) จะเห็นว่า จำนวนตัวอักษรที่ต้องการ จะต้องเป็นข้อมูลที่เป็น Number (ตัวเลข) เท่านั้น แปลว่า หากเรามีสูตรที่ได้ผลลัพธ์เป็นตัวเลข เราก็สามารถผสมสูตรนั้นลงไปในช่อง “จำนวนตัวอักษรที่ต้องการ” ได้เช่นกัน
  • เราจะเข้าใจการทำงานของ Excel มากขึ้น เช่น เราจะเข้าใจว่า ทำไมเวลาเอาวันที่มาลบกันแล้วจะได้ออกมาเป็นช่วงเวลาระยะห่างของสองวันได้ (เพราะ Excel มองว่าวันที่คือตัวเลขตัวหนึ่งนั่นเอง)

เมื่อคุณอ่านบทความนี้จบแล้ว ก็น่าจะมีพื้นฐานเกี่ยวกับประเภทข้อมูลใน Excel กันแล้วล่ะ ในตอนต่อๆ ไปเราจะได้มาเรียนรู้วิธีการใช้สูตร (Formula) กันครับ

แชร์ความรู้ให้เพื่อนๆ ของคุณ
1    
1    

ติดตามเทพเอ็กเซล

  • Facebook
  • YouTube

อบรมกับเทพเอ็กเซล

คอร์สออนไลน์ เทพเอ็กเซล
คอร์สออนไลน์ จากเทพเอ็กเซล ดูกี่รอบก็ได้
อบรม Excel / Power BI ให้องค์กรของคุณ

บทความล่าสุด

  • การทำ Simulation ด้วย Excel
  • แกะเคล็ดวิชา Excel Wizard ในการแข่ง Speed Run Excel ระดับโลก
  • เจาะลึก CALCULATE ใน DAX แบบลึกสุดใจ : Part 2
  • วิธีใช้ Power Query ดึงข้อมูล EMS Tracking จากไปรษณีย์ไทย ผ่าน Web API
  • เจาะลึก CALCULATE ใน DAX แบบลึกสุดใจ : Part 1
  • Series สอนดึงข้อมูลจากเว็บ ด้วย Power Automate Desktop
  • ทำความเข้าใจวิธีสั่ง MidJourney แบบละเอียด เพื่อให้ได้ผลลัพธ์ตรงใจ (มากขึ้น)

บทความแนะนำ

🔥ฟังก์ชันทั้งหมดใน Excel 🔥

  • แกะเคล็ดวิชา Excel Wizard ในการแข่ง Speed Run Excel ระดับโลก
  • เจาะลึก CALCULATE ใน DAX แบบลึกสุดใจ : Part 1
  • Series สอนดึงข้อมูลจากเว็บ ด้วย Power Automate Desktop
  • สรุปการใช้ LAMBDA ฟังก์ชันที่ใช้สร้างฟังก์ชันใน Excel 365 และผองเพื่อน
  • วิธีใช้ Excel คำนวณระยะเวลาการทำงานรวม แถมระบุเวลาพักได้แบบยืดหยุ่น
  • วิธีจัดการข้อมูลแย่ๆ ด้วย Power Query ทั้งข้อมูลปนกัน ข้อมูลอยู่บนหัวตาราง
  • แยกข้อมูลที่อยู่สุดเน่า ด้วย Excel Power Query

Categories

Tags

collection concepts copy database Data Model data table data validation date dax dropdown error excel filter finance find format formula function game graph IF index intro iterative len link logic lookup match m code merge mid overview paste pivot power query project row sort speed split substitute table text textjoin time tips trim vba vlookup

Archives

  • January 2023 (1)
  • October 2022 (1)
  • September 2022 (3)
  • August 2022 (3)
  • July 2022 (1)
  • June 2022 (3)
  • May 2022 (1)
  • April 2022 (2)
  • February 2022 (1)
  • December 2021 (2)
  • November 2021 (10)
  • September 2021 (2)
  • August 2021 (6)
  • July 2021 (2)
  • June 2021 (2)
  • May 2021 (10)
  • April 2021 (3)
  • March 2021 (3)
  • February 2021 (4)
  • January 2021 (8)
  • December 2020 (5)
  • November 2020 (13)
  • October 2020 (5)
  • September 2020 (11)
  • August 2020 (4)
  • July 2020 (13)
  • June 2020 (17)
  • May 2020 (16)
  • April 2020 (16)
  • March 2020 (10)
  • February 2020 (15)
  • January 2020 (16)
  • December 2019 (4)
  • November 2019 (3)
  • October 2019 (9)
  • September 2019 (1)
  • August 2019 (7)
  • June 2019 (3)
  • May 2019 (9)
  • April 2019 (9)
  • March 2019 (2)
  • February 2018 (1)
  • January 2018 (3)
  • November 2017 (3)
  • August 2017 (1)
  • July 2017 (1)
  • June 2017 (1)
  • May 2017 (6)
  • April 2017 (6)
  • March 2017 (7)
  • February 2017 (1)
  • January 2017 (2)
  • December 2016 (1)
  • October 2016 (2)
  • September 2016 (3)
  • August 2016 (2)
  • July 2016 (2)
  • June 2016 (1)
  • May 2016 (1)
  • April 2016 (1)
  • March 2016 (2)
  • February 2016 (1)
  • January 2016 (2)
  • December 2015 (2)
  • November 2015 (5)
  • October 2015 (3)
  • June 2015 (2)
  • May 2015 (1)
  • April 2015 (26)
  • January 2015 (1)
  • December 2014 (1)
  • November 2014 (2)
  • October 2014 (1)
  • September 2014 (2)
  • August 2014 (1)
  • June 2014 (1)
  • May 2014 (1)
  • April 2014 (3)
  • March 2014 (3)
  • February 2014 (12)
  • January 2014 (7)
  • December 2013 (2)
  • November 2013 (8)
  • October 2013 (2)

เทพเอ็กเซล : Thep Excel

copyright © 2022

  • Facebook
  • YouTube
เว็บไซต์นี้ใช้คุกกี้ (Cookies)
บริษัท เทพเอ็กเซล จำกัด ให้ความสำคัญต่อข้อมูลส่วนบุคคลของท่าน เพื่อการพัฒนาและปรับปรุงเว็บไซต์รวมถึงสินค้าและบริการต่างๆ หากท่านใช้บริการเว็บไซต์นี้ โดยไม่มีการปรับตั้งค่าใดๆ แสดงว่าท่านยินยอมที่จะรับคุกกี้บนเว็บไซต์ และนโยบายสิทธิส่วนบุคคลของเรา
ตั้งค่าคุกกี้ยอมรับทั้งหมดอ่านเพิ่มเติม
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT