ไปยังเนื้อหาหลัก

วิธีการนับค่าที่ไม่ซ้ำกันในตาราง Pivot?

โดยค่าเริ่มต้นเมื่อเราสร้างตาราง Pivot ตามช่วงของข้อมูลที่มีค่าที่ซ้ำกันระเบียนทั้งหมดจะถูกนับด้วย แต่บางครั้งเราก็แค่ต้องการนับค่าที่ไม่ซ้ำกันตามคอลัมน์เดียวเพื่อให้ได้สิทธิ ผลภาพหน้าจอ ในบทความนี้ฉันจะพูดถึงวิธีการนับค่าที่ไม่ซ้ำกันในตาราง Pivot

นับค่าที่ไม่ซ้ำกันในตาราง Pivot ด้วยคอลัมน์ตัวช่วย

นับค่าที่ไม่ซ้ำกันในตาราง Pivot ด้วยการตั้งค่าฟิลด์ค่าใน Excel 2013 และเวอร์ชันที่ใหม่กว่า


นับค่าที่ไม่ซ้ำกันในตาราง Pivot ด้วยคอลัมน์ตัวช่วย

ใน Excel คุณต้องสร้างคอลัมน์ตัวช่วยเพื่อระบุค่าที่ไม่ซ้ำกันโปรดทำตามขั้นตอนต่อไปนี้:

1. ในคอลัมน์ใหม่นอกเหนือจากข้อมูลโปรดป้อนสูตรนี้ =IF(SUMPRODUCT(($A$2:$A2=A2)*($B$2:$B2=B2))>1,0,1) ลงในเซลล์ C2 จากนั้นลากจุดจับเติมไปยังเซลล์ช่วงที่คุณต้องการใช้สูตรนี้และค่าที่ไม่ซ้ำกันจะถูกระบุตามภาพหน้าจอด้านล่าง:

2. ตอนนี้คุณสามารถสร้างตาราง Pivot เลือกช่วงข้อมูลรวมถึงคอลัมน์ผู้ช่วยเหลือจากนั้นคลิก สิ่งที่ใส่เข้าไป > PivotTable > PivotTableดูภาพหน้าจอ:

3. จากนั้นใน สร้าง PivotTable โต้ตอบเลือกแผ่นงานใหม่หรือแผ่นงานที่มีอยู่ที่คุณต้องการวางตารางสาระสำคัญดูภาพหน้าจอ:

4. คลิก OKจากนั้นลากไฟล์ ชั้น ฟิลด์ไปที่ ป้ายกำกับแถว แล้วลากไฟล์ ผู้ช่วยเหลือ คอลัมน์ ฟิลด์ไปที่ ความคุ้มค่า และคุณจะได้รับตาราง Pivot ต่อไปนี้ซึ่งจะนับเฉพาะค่าที่ไม่ซ้ำกัน


นับค่าที่ไม่ซ้ำกันในตาราง Pivot ด้วยการตั้งค่าฟิลด์ค่าใน Excel 2013 และเวอร์ชันที่ใหม่กว่า

ใน Excel 2013 และเวอร์ชันที่ใหม่กว่าเป็นไฟล์ จำนวนที่แตกต่าง เพิ่มฟังก์ชันในตารางเดือยแล้วคุณสามารถใช้คุณสมบัตินี้เพื่อแก้ปัญหานี้ได้อย่างรวดเร็วและง่ายดาย

1. เลือกช่วงข้อมูลของคุณแล้วคลิก สิ่งที่ใส่เข้าไป > PivotTableใน สร้าง PivotTable ไดอะล็อกบ็อกซ์เลือกแผ่นงานใหม่หรือแผ่นงานที่มีอยู่ที่คุณต้องการวางตาราง Pivot และตรวจสอบ เพิ่มข้อมูลนี้ในโมเดลข้อมูล ช่องทำเครื่องหมายดูภาพหน้าจอ:

2. จากนั้นใน เขตข้อมูล PivotTable บานหน้าต่างลากไฟล์ ชั้น ไปยังไฟล์ แถว แล้วลากไฟล์ Name ไปยังไฟล์ ความคุ้มค่า ดูภาพหน้าจอ:

3. แล้วคลิก จำนวนชื่อ รายการแบบเลื่อนลงเลือก การตั้งค่าฟิลด์ค่าดูภาพหน้าจอ:

4. ใน การตั้งค่าฟิลด์ค่า โต้ตอบคลิก สรุปค่าตาม จากนั้นเลื่อนเพื่อคลิก จำนวนที่แตกต่าง ตัวเลือกดูภาพหน้าจอ:

5. จากนั้นคลิก OKคุณจะได้รับตาราง Pivot ซึ่งนับเฉพาะค่าที่ไม่ซ้ำกัน

  • หมายเหตุ: หากคุณตรวจสอบ เพิ่มข้อมูลนี้ในโมเดลข้อมูล ตัวเลือกใน สร้าง PivotTable ไดอะล็อกบ็อกซ์ ฟิลด์ที่คำนวณ ฟังก์ชันจะถูกปิดใช้งาน

บทความ PivotTable ที่เกี่ยวข้องเพิ่มเติม:

  • ใช้ตัวกรองเดียวกันกับตาราง Pivot หลายตัว
  • บางครั้งคุณอาจสร้างตาราง Pivot หลายตารางโดยใช้แหล่งข้อมูลเดียวกันและตอนนี้คุณกรองตาราง Pivot หนึ่งตารางและต้องการให้ตาราง Pivot อื่น ๆ ถูกกรองด้วยวิธีเดียวกันเช่นกันนั่นหมายความว่าคุณต้องการเปลี่ยนตัวกรองตาราง Pivot หลายรายการพร้อมกันใน Excel บทความนี้ผมจะพูดถึงการใช้งานฟีเจอร์ใหม่ Slicer ใน Excel 2010 และเวอร์ชันที่ใหม่กว่า
  • อัปเดตช่วงตาราง Pivot ใน Excel
  • ใน Excel เมื่อคุณลบหรือเพิ่มแถวหรือคอลัมน์ในช่วงข้อมูลของคุณตาราง Pivot สัมพัทธ์จะไม่อัปเดตพร้อมกัน ตอนนี้บทช่วยสอนนี้จะบอกวิธีอัปเดตตาราง Pivot เมื่อแถวหรือคอลัมน์ของตารางข้อมูลเปลี่ยนไป
  • ซ่อนแถวว่างใน PivotTable ใน Excel
  • ดังที่เราทราบกันดีว่าตารางสาระสำคัญนั้นสะดวกสำหรับเราในการวิเคราะห์ข้อมูลใน Excel แต่บางครั้งก็มีเนื้อหาว่างบางส่วนปรากฏในแถวตามภาพหน้าจอด้านล่าง ตอนนี้ฉันจะบอกวิธีซ่อนแถวว่างเหล่านี้ในตาราง Pivot ใน Excel

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (28)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Thanks ! Saved me a lot of hours, me and my friend !
This comment was minimized by the moderator on the site
My Excel dont have check box " Add this data to the Data Model"
So, What can i do?
This comment was minimized by the moderator on the site
It supports only . xlsx
I have faced with the same problem. Nodody mention this. Everyone talk about MS Excel, and nobody about file)))
This comment was minimized by the moderator on the site
Hello, Jay,
Which Excel version do you use? This option is only added for Excl 2013 and later versions. If you do not find this option, please apply the first method in this article.
https://www.extendoffice.com/documents/excel/2127-excel-pivot-table-count-unique-values.html#a1

Thank you!
This comment was minimized by the moderator on the site
Thank you so much !!!!!
This comment was minimized by the moderator on the site
I cannot edit after I save. Can yo tell me why?
This comment was minimized by the moderator on the site
sorry, this still doesn't provide a solution for me in excel 2010. You're =if(sumproduct() formula doesn't work. It misses the values for the if formula if you use it like you put it and it doesn't count unique values in my excel sheet if I add =if(>1,01;1;0)...
This comment was minimized by the moderator on the site
oh man... you saved me so so so much time !!!
thanks a lot !!!!
This comment was minimized by the moderator on the site
Distinct count Option not shown in summarize value by - Excel version 2013
This comment was minimized by the moderator on the site
Please verify that you have ticked the "Add this data to data model" check in the CreatePivot dialog box :)
This comment was minimized by the moderator on the site
I faced the same issue and then found the resolution.
Seems that it's available only when you tick the "Add this data to the Data Model" checkbox in the Create PivotTable dialog box.
Please try if that helps
This comment was minimized by the moderator on the site
same for me! Any suggestion?
This comment was minimized by the moderator on the site
These all work but only to an extent. I'm trying to find a solution for the issue with all of these. When I create a helper column and use the formula =IF(SUMPRODUCT(($A$2:$A2=A2)*($B$2:$B2=B2))>1,0,1) I do indeed get the distinct count. But how do you resolve the issue were you need the pivot fields to include one of the lines of data where the formula gives a zero? I also tried using the Data Model and distinct count. This gives the correct count but when you double click the data to drill down you do not get the data specified in the pivot.
This comment was minimized by the moderator on the site
Amazing! thanks a tons - this worked for me on Excel 2016.
This comment was minimized by the moderator on the site
I don't see the Distinct Count under Summarize Value By tab. My "Add this data to the Data model" check box is also grey out. How can I change this setting?
This comment was minimized by the moderator on the site
Ran into the same issue... it is probably because the file you opened was as a csv. When I reopened my file as an excel file (either start a new one, copy+paste or save as), I have the functionality of adding to data model
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations