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

วิธีการนับค่าที่ไม่ซ้ำกันตามเกณฑ์หลายเกณฑ์ใน Excel

บทความนี้ฉันจะนำตัวอย่างบางส่วนเพื่อให้คุณนับค่าที่ไม่ซ้ำกันตามเกณฑ์อย่างน้อยหนึ่งเกณฑ์ในแผ่นงาน ขั้นตอนโดยละเอียดต่อไปนี้อาจช่วยคุณได้

นับค่าที่ไม่ซ้ำกันตามเกณฑ์เดียว

นับค่าที่ไม่ซ้ำกันตามวันที่กำหนดสองวัน

นับค่าที่ไม่ซ้ำกันตามเกณฑ์สองข้อ

นับค่าที่ไม่ซ้ำกันตามเกณฑ์สามข้อ


ลูกศรสีฟ้าฟองขวา นับค่าที่ไม่ซ้ำกันตามเกณฑ์เดียว

ตัวอย่างเช่นฉันมีช่วงข้อมูลต่อไปนี้ตอนนี้ฉันต้องการนับผลิตภัณฑ์เฉพาะที่ทอมขาย

doc นับไม่ซ้ำกับหลายเกณฑ์ 1

โปรดป้อนสูตรนี้ลงในเซลล์ว่างที่คุณต้องการให้ได้ผลลัพธ์เช่น G2:

= SUM (IF ("Tom" = $ C $ 2: $ C $ 20, 1 / (COUNTIFS ($ C $ 2: $ C $ 20, "Tom", $ A $ 2: $ A $ 20, $ A $ 2: $ A $ 20) ), 0))จากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่ถูกต้องดูภาพหน้าจอ:

doc นับไม่ซ้ำกับหลายเกณฑ์ 2

หมายเหตุ: ในสูตรข้างต้น“ทอม” คือเกณฑ์ชื่อที่คุณต้องการนับตาม C2: C20 คือเซลล์มีเกณฑ์ชื่อ A2: A20 คือเซลล์ที่คุณต้องการนับค่าเฉพาะ


ลูกศรสีฟ้าฟองขวา นับค่าที่ไม่ซ้ำกันตามวันที่กำหนดสองวัน

ในการคำนวณค่าที่ไม่ซ้ำกันระหว่างวันที่ที่กำหนดสองวันตัวอย่างเช่นฉันต้องการนับผลิตภัณฑ์ที่ไม่ซ้ำกันระหว่างช่วงวันที่ 2016/9/1 และ 2016/9/30 โปรดใช้สูตรนี้:

= SUM (IF ($ D $ 2: $ D $ 20 <= DATE (2016, 9, 30) * ($ D $ 2: $ D $ 20> = DATE (2016, 9, 1)), 1 / COUNTIFS ($ A $ 2 : $ A $ 20, $ A $ 2: $ A $ 20, $ D $ 2: $ D $ 20, "<=" & DATE (2016, 9, 30), $ D $ 2: $ D $ 20, "> =" & DATE (2016, 9, 1))), 0)จากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่เป็นเอกลักษณ์ดูภาพหน้าจอ:

doc นับไม่ซ้ำกับหลายเกณฑ์ 3

หมายเหตุ: ในสูตรข้างต้นวันที่ 2016,9,1 และ 2016,9,30 คือวันที่เริ่มต้นและวันที่สิ้นสุดที่คุณต้องการนับตาม D2: D20 เซลล์มีเกณฑ์วันที่หรือไม่ A2: A20 คือเซลล์ที่คุณต้องการนับค่าที่ไม่ซ้ำกัน


ลูกศรสีฟ้าฟองขวา นับค่าที่ไม่ซ้ำกันตามเกณฑ์สองข้อ

หากคุณต้องการนับสินค้าเฉพาะที่ทอมขายในเดือนกันยายนสูตรต่อไปนี้สามารถช่วยคุณได้

โปรดป้อนสูตรนี้ลงในเซลล์ว่างเพื่อแสดงผลลัพธ์เช่น H2

= SUM (IF (("Tom" = $ C $ 2: $ C $ 20) * ($ D $ 2: $ D $ 20 <= DATE (2016, 9, 30) * ($ D $ 2: $ D $ 20> = DATE ( 2016, 9, 1)), 1 / COUNTIFS ($ C $ 2: $ C $ 20, "Tom", $ A $ 2: $ A $ 20, $ A $ 2: $ A $ 20, $ D $ 2: $ D $ 20, " <= "& DATE (2016, 9, 30), $ D $ 2: $ D $ 20,"> = "& DATE (2016, 9, 1))), 0) จากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่เป็นเอกลักษณ์ดูภาพหน้าจอ:

doc นับไม่ซ้ำกับหลายเกณฑ์ 4

หมายเหตุ:

1. ในสูตรข้างต้น“ทอม” คือเกณฑ์ชื่อ 2016,9,1 และ 2016,9,30 คือวันที่สองวันที่คุณต้องการนับตาม C2: C20 คือเซลล์มีเกณฑ์ชื่อและ D2: D20 เซลล์มีวันที่หรือไม่ A2: A20 คือช่วงของเซลล์ที่คุณต้องการนับค่าที่ไม่ซ้ำกัน

2. หากคุณจำเป็นต้องใช้“or” เกณฑ์ในการนับค่าที่ไม่ซ้ำกันเช่นคำนวณผลิตภัณฑ์ที่ทอมหรือภาคใต้ขายโปรดใช้สูตรนี้

=SUM(--(FREQUENCY(IF(("Tom"=$C$2:$C$20)+("South"=$B$2:$B$20), COUNTIF($A$2:$A$20, "<"&$A$2:$A$20), ""), COUNTIF($A$2:$A$20, "<"&$A$2:$A$20))>0))และอย่าลืมกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่เป็นเอกลักษณ์ดูภาพหน้าจอ:

doc นับไม่ซ้ำกับหลายเกณฑ์ 5


ลูกศรสีฟ้าฟองขวา นับค่าที่ไม่ซ้ำกันตามเกณฑ์สามข้อ

ในการนับผลิตภัณฑ์ที่ไม่ซ้ำกันด้วยเกณฑ์สามข้อสูตรอาจซับซ้อนกว่านี้ สมมติว่าการคำนวณผลิตภัณฑ์เฉพาะที่ Tom จำหน่ายในเดือนกันยายนและในภูมิภาค North กรุณาทำตามนี้:

ป้อนสูตรนี้ลงในเซลล์ว่างเพื่อแสดงผลลัพธ์ I2 ตัวอย่างเช่น:

= SUM (IF (("Tom" = $ C $ 2: $ C $ 20) * ($ D $ 2: $ D $ 20 <= DATE (2016, 9, 30)) * ($ D $ 2: $ D $ 20> = DATE (2016, 9, 1)) * ("เหนือ" = $ B $ 2: $ B $ 20), 1 / COUNTIFS ($ C $ 2: $ C $ 20, "Tom", $ A $ 2: $ A $ 20, $ A $ 2 : $ A $ 20, $ D $ 2: $ D $ 20, "<=" & DATE (2016, 9, 30), $ D $ 2: $ D $ 20, "> =" & DATE (2016, 9, 1), $ B $ 2 : $ B $ 20, "ทิศเหนือ")), 0)จากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่เป็นเอกลักษณ์ดูภาพหน้าจอ:

doc นับไม่ซ้ำกับหลายเกณฑ์ 6

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

🤖 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 (19)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
For all the above formula an you suggest a non array formula as my data runs to 25000 rows. I need a free suggestions and not paid ones
This comment was minimized by the moderator on the site
Hi,
This is great - except I cant get it to work for what I require
I have two sheets - a Summary sheet, and another sheet containing data
The dates are dynamic - so you enter the date ranges in the Summary sheet in two cells (from B2 to D2)
When I replace DATE(2022,6,1) with B2 it comes back with "a value used in the formula is the wrong data type"
When I test with putting DATE(2022,6,1) and DATE (2022,6,30) in the from - to parts in the formula - I get 0 as the result - which is wrong.
Note: I'm in Ireland - so the date format here is dd.mm.yy - changing things doesn't fix - and adds confusion tbh
My formula is
=SUM(IF(Sheet4!$C$2:Sheet4!$C$65<=(D2)*(Sheet4!$C$2:Sheet4!$C$65>=(B2)), 1/COUNTIFS(Sheet4!$A$2:Sheet4!$A$65, Sheet4!$A$2:Sheet4!$A$65, Sheet4!$C$2:Sheet4!$C$65, "<="&D2,Sheet4!$C$2:Sheet4!$C$65, ">="&B2))),0)
Where Sheet4 contains the data, C2:C65 are cells with dates, A2:A65 are cells with project numbers - where there maybe duplicates
Any help - greatly appreciated,
Thanks
This comment was minimized by the moderator on the site
1 month2 brand name 3 executive wise4 mix party nameCount unique party name
This comment was minimized by the moderator on the site
Count Unique Values Based On four Criteria
This comment was minimized by the moderator on the site
I am trying to use this method to calculate unique customers for a particular product (where a customer may have bought multiple times, but I want unique customers). If I enter the formula but limit the range to a subset of just 5 rows that I know contain a duplicate customer, it works fine. But when I apply to the whole column, e.g. $D:$D, it calculates endlessly; if it finishes, it returns a wrong result. But now it's not even finishing and I have to end the Excel process. Is this just too costly in terms of CPU to apply to a large volume of data (e.g. 1500 rows)?
This comment was minimized by the moderator on the site
I ma getting value in point which is not possible So please help me Out

{=SUM(IF(("Regular"='Raw Data'!$G$5:$G$1785)*('Raw Data'!$D$5:$D$1785<=DATE(2019,6,30)*('Raw Data'!$D$5:$D$1785>=DATE(2019,6,1))),1/COUNTIFS('Raw Data'!$B$5:$B$1785,'Raw Data'!$B$5:$B$1785,'Raw Data'!$D$5:$D$1785,"<="&DATE(2019,6,30),'Raw Data'!$D$5:$D$1785,">="&DATE(2019,6,1))),0)}
This comment was minimized by the moderator on the site
my question.
I mean that filtered rows , and not count hidden rows.
This comment was minimized by the moderator on the site
"if count visible rows."
I mean filtered rows , and not count rows hidden.
This comment was minimized by the moderator on the site
Ffrom this article formula,
if count visible rows. how can add or edit formula?
This comment was minimized by the moderator on the site
The greater and less than date criteria is a distracting example of how to use the sumif array.
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