TechNet
Products
IT Resources
Downloads
Training
Support
Products
Windows
Windows Server
System Center
Microsoft Edge
Office
Office 365
Exchange Server
SQL Server
SharePoint Products
Skype for Business
See all products »
Resources
Channel 9 Video
Evaluation Center
Learning Resources
Microsoft Tech Companion App
Microsoft Technical Communities
Microsoft Virtual Academy
Script Center
Server and Tools Blogs
TechNet Blogs
TechNet Flash Newsletter
TechNet Gallery
TechNet Library
TechNet Magazine
TechNet Wiki
Windows Sysinternals
Virtual Labs
Solutions
Networking
Cloud and Datacenter
Security
Virtualization
Updates
Service Packs
Security Bulletins
Windows Update
Trials
Windows Server 2016
System Center 2016
Windows 10 Enterprise
SQL Server 2016
See all trials »
Related Sites
Microsoft Download Center
Microsoft Evaluation Center
Drivers
Windows Sysinternals
TechNet Gallery
Training
Expert-led, virtual classes
Training Catalog
Class Locator
Microsoft Virtual Academy
Free Windows Server 2012 courses
Free Windows 8 courses
SQL Server training
Microsoft Official Courses On-Demand
Certifications
Certification overview
Special offers
MCSE Cloud Platform and Infrastructure
MCSE: Mobility
MCSE: Data Management and Analytics
MCSE Productivity
Other resources
Microsoft Events
Exam Replay
Born To Learn blog
Find technical communities in your area
Azure training
Official Practice Tests
Support options
For business
For developers
For IT professionals
For technical support
Support offerings
More support
Microsoft Premier Online
TechNet Forums
MSDN Forums
Security Bulletins & Advisories
Not an IT pro?
Microsoft Customer Support
Microsoft Community Forums
Sign in
Home
Library
Wiki
Learn
Gallery
Downloads
Support
Forums
Blogs
Resources For IT Professionals
United States (English)
Россия (Pусский)
中国(简体中文)
Brasil (Português)
Skip to locale bar
Post an article
Translate this page
Powered by
Microsoft® Translator
Wikis - Page Details
First published by
Somkiat Foongkiat - Bangkok, Thailand
(eMV)
When:
18 Mar 2013 1:50 AM
Revisions:
1
Comments:
0
Options
Subscribe to Article (RSS)
Share this
Can You Improve This Article?
Positively!
Click Sign In to add the tip, solution, correction or comment that will help other users.
Report inappropriate content using
these instructions
.
Wiki
>
TechNet Articles
>
Changing Duplicated Data to be Unique Data (th-TH)
Changing Duplicated Data to be Unique Data (th-TH)
Article
History
Changing Duplicated Data to be Unique Data (th-TH)
แม้สูตร Multiple Match จะช่วยลัดหาตัวเลขตำแหน่งรายการที่ซ้ำกันให้ทันทีที่มีการเปลี่ยนแปลงแก้ไขข้อมูลก็ตาม แต่สูตรนี้ต้องสร้างแบบ Array ลงไปในตารางพร้อมกัน จึงค่อนข้างยากและเสี่ยงสำหรับมือใหม่ซึ่งไม่คุ้นเคยกับสูตร Array มาก่อนที่จะปรับแต่งสูตรให้เข้ากับงานของตนหากขาดพื้นฐานที่ไปที่มาว่าสูตรนี้คำนวณเลขตำแหน่งรายการที่ซ้ำมาได้อย่างไร
แทนที่จะใช้สูตร Multiple Match กับตารางที่มีรายการซ้ำกัน ให้หาทางปรับค่าซ้ำในตารางฐานข้อมูลให้เกิดค่าใหม่ที่ไม่ซ้ำหรืออีกนัยหนึ่งคือปรับค่าซ้ำให้กลายเป็น Unique Item ซึ่งสามารถใช้สูตร VLookup หรือ Match และ Index ในการค้นหาข้อมูลที่ต้องการได้ง่ายและรวดเร็วกว่าสูตร Multiple Match ที่ใช้เวลาในการคำนวณแบบ Array ช้ากว่า
สังเกตว่าเดิมรหัส ID ในเซลล์ B3:B7 มีรหัสบันทึกไว้ซ้ำ ส่วนรหัสใหม่ NewID ในเซลล์ D3:D7 ไม่มีรหัสใดซ้ำกันอยู่เลยเป็น Unique Item
ให้เริ่มจากเพิ่ม column C และ D แล้วสร้างสูตร =COUNTIF($B$3:B3,B3) ลงไปในเซลล์ C3 แล้ว copy ลงไปในเซลล์ C3:C7 คู่ขนานกับรหัส ID เดิมให้ครบทุกตัว เลขผลลัพธ์ 1, 1, 2, 1, และ 2 ที่ได้ เป็นเลขแสดงตัวที่ซ้ำของรหัสแต่ละตัวนั่นเอง เช่น เลข 1 ที่ได้ในเซลล์ C3 หมายความว่า a001 ในเซลล์ B3 เป็น a001 ตัวที่ 1 ส่วนเลข 2 ในเซลล์ C5 หมายความว่า a001 ในเซลล์ B5 เป็น a001 ตัวที่ 2
จากนั้นให้สร้างรหัส NewID ในเซลล์ D3 สร้างสูตร =B3&"-"&C3 แล้ว copy ลงไปให้ครบเซลล์ D3:D7 จะเกิดรหัสใหม่ที่ไม่ซ้ำ เช่น a001-2 แสดงว่าเป็นรหัส a001 ตัวที่ 2 แล้วใช้รหัสใหม่นี้ในการค้นหาข้อมูลของรหัสที่กรอกลงไปในเซลล์ H3 ด้วยสูตร VLookup ในเซลล์ I3 และ J3 ต่อไป
แม้วิธีนี้ทำให้มีจำนวนเซลล์สูตรเพิ่มขึ้น ซึ่งย่อมทำให้แฟ้มมีขนาดใหญ่ขึ้น แต่เวลาที่ใช้คำนวณอาจรวดเร็วกว่าการใช้สูตร Multiple Match ในแฟ้มที่มีขนาดเล็กกว่าก็เป็นได้
Excel
,
Functions
,
somkiat foongkiat
,
th-TH
,
สมเกียรติ ฟุ้งเกียรติ
[Edit tags]
Leave a Comment
Please add 3 and 7 and type the answer here:
Post
Wiki - Revision Comment List(Revision Comment)
Wikis - Comment List