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

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

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

รวมค่าที่ไม่ซ้ำกันตามเกณฑ์อย่างน้อยหนึ่งเกณฑ์ด้วยสูตรอาร์เรย์


รวมค่าที่ไม่ซ้ำกันตามเกณฑ์อย่างน้อยหนึ่งเกณฑ์ด้วยสูตรอาร์เรย์

หากต้องการรวมเฉพาะค่าที่ไม่ซ้ำตามเกณฑ์ในคอลัมน์อื่นโปรดใช้สูตรด้านล่าง:

1. โปรดคัดลอกหรือป้อนสูตรอาร์เรย์ต่อไปนี้ลงในเซลล์ว่าง:

=SUM(IF(FREQUENCY(IF($A$2:$A$12=D2,MATCH($B$2:$B$12,$B$2:$B$12,0)),ROW($B$2:$B$12)-ROW($B$2)+1),$B$2:$B$12))

หมายเหตุ: ในสูตรข้างต้น A2: A12 คือข้อมูลคอลัมน์มีค่าเงื่อนไข D2 คือเงื่อนไขที่คุณต้องการรวมค่าตาม B2: B12 คือคอลัมน์มีค่าที่คุณต้องการรวม

2. จากนั้นกด Ctrl + Shift + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์รวมแรกจากนั้นเลือกเซลล์สูตรนี้แล้วลากจุดจับเติมลงไปที่เซลล์เพื่อรับค่ารวมทั้งหมดสำหรับแต่ละรายการ ดูภาพหน้าจอ:

เคล็ดลับ: หากคุณต้องการรวมค่าที่ไม่ซ้ำกันทั้งหมดตามเกณฑ์สองข้อโปรดใช้สูตรด้านล่าง:

=SUM(IF(FREQUENCY(IF($A$2:$A$12=E2,IF($B$2:$B$12=F2,MATCH($C$2:$C$12,$C$2:$C$12,0))),ROW($C$2:$C$12)-ROW($C$2)+1),$C$2:$C$12))


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

  • รวมหลายคอลัมน์ตามเกณฑ์เดียวใน Excel
  • ใน Excel คุณอาจต้องรวมหลายคอลัมน์ตามเกณฑ์เดียวเสมอ ตัวอย่างเช่นฉันมีช่วงข้อมูลตามภาพหน้าจอต่อไปนี้ตอนนี้ฉันต้องการรับค่า KTE ทั้งหมดในสามเดือน - ม.ค. ก.พ. และ มี.ค.
  • Vlookup และผลรวมตรงกันในแถวหรือคอลัมน์ใน Excel
  • การใช้ vlookup และฟังก์ชัน sum ช่วยให้คุณค้นหาเกณฑ์ที่ระบุได้อย่างรวดเร็วและรวมค่าที่เกี่ยวข้องในเวลาเดียวกัน ในบทความนี้เราจะแสดงวิธีการสองวิธีในการ vlookup และรวมค่าแรกหรือทั้งหมดที่ตรงกันในแถวหรือคอลัมน์ใน Excel
  • ค่ารวมตามเดือนและปีใน Excel
  • หากคุณมีช่วงข้อมูลคอลัมน์ A จะมีวันที่และคอลัมน์ B มีจำนวนคำสั่งซื้อตอนนี้คุณต้องรวมตัวเลขตามเดือนและปีจากคอลัมน์อื่น ในกรณีนี้ฉันต้องการคำนวณคำสั่งซื้อทั้งหมดของเดือนมกราคม 2016 เพื่อให้ได้ผลลัพธ์ต่อไปนี้ และบทความนี้ฉันจะพูดถึงเทคนิคบางอย่างในการแก้ปัญหานี้ใน Excel
  • ค่ารวมตามเกณฑ์ข้อความใน Excel
  • ใน Excel คุณเคยพยายามรวมค่าตามคอลัมน์อื่นของเกณฑ์ข้อความหรือไม่? ตัวอย่างเช่นฉันมีช่วงของข้อมูลในแผ่นงานดังภาพหน้าจอต่อไปนี้ที่แสดงตอนนี้ฉันต้องการเพิ่มตัวเลขทั้งหมดในคอลัมน์ B ที่สอดคล้องกับค่าข้อความในคอลัมน์ A ที่ตรงตามเกณฑ์ที่กำหนดเช่นรวมตัวเลขหาก เซลล์ในคอลัมน์ A มี KTE
  • ค่ารวมตามการเลือกรายการแบบหล่นลงใน Excel
  • ตามภาพหน้าจอด้านล่างนี้คุณมีตารางประกอบด้วยคอลัมน์ประเภทและคอลัมน์จำนวนและคุณได้สร้างรายการแบบเลื่อนลงการตรวจสอบข้อมูลซึ่งประกอบด้วยหมวดหมู่ทั้งหมด เมื่อเลือกประเภทใด ๆ จากรายการดรอปดาวน์คุณต้องการสรุปค่าเซลล์ที่เกี่ยวข้องทั้งหมดในคอลัมน์ B และเติมผลลัพธ์ในเซลล์ที่ระบุ ตัวอย่างเช่นเมื่อเลือกประเภท CC จากรายการแบบเลื่อนลงคุณต้องรวมค่าในเซลล์ B5 และ B8 และรับจำนวนทั้งหมด 40 + 70 = 110 จะบรรลุได้อย่างไร? วิธีการในบทความนี้สามารถช่วยคุณได้

เครื่องมือเพิ่มประสิทธิภาพการทำงานในสำนักงานที่ดีที่สุด

Kutools สำหรับ Excel แก้ปัญหาส่วนใหญ่ของคุณและเพิ่มผลผลิตของคุณได้ถึง 80%

  • ซุปเปอร์ฟอร์มูล่าบาร์ (แก้ไขข้อความและสูตรหลายบรรทัดได้อย่างง่ายดาย); การอ่านเค้าโครง (อ่านและแก้ไขเซลล์จำนวนมากได้อย่างง่ายดาย); วางลงในช่วงที่กรองแล้ว...
  • ผสานเซลล์ / แถว / คอลัมน์ และการเก็บรักษาข้อมูล แยกเนื้อหาของเซลล์ รวมแถวที่ซ้ำกันและผลรวม / ค่าเฉลี่ย... ป้องกันเซลล์ซ้ำ; เปรียบเทียบช่วง...
  • เลือกซ้ำหรือไม่ซ้ำ แถว; เลือกแถวว่าง (เซลล์ทั้งหมดว่างเปล่า); Super Find และ Fuzzy Find ในสมุดงานจำนวนมาก สุ่มเลือก ...
  • สำเนาถูกต้อง หลายเซลล์โดยไม่เปลี่ยนการอ้างอิงสูตร สร้างการอ้างอิงอัตโนมัติ ถึงหลายแผ่น ใส่สัญลักษณ์แสดงหัวข้อย่อย, กล่องกาเครื่องหมายและอื่น ๆ ...
  • แทรกสูตรที่ชื่นชอบและรวดเร็ว, ช่วงแผนภูมิและรูปภาพ; เข้ารหัสเซลล์ ด้วยรหัสผ่าน; สร้างรายชื่อผู้รับจดหมาย และส่งอีเมล ...
  • แยกข้อความ, เพิ่มข้อความ, ลบตามตำแหน่ง, ลบ Space; สร้างและพิมพ์ผลรวมย่อยของเพจ แปลงระหว่างเนื้อหาของเซลล์และความคิดเห็น...
  • ซุปเปอร์ฟิลเตอร์ (บันทึกและใช้โครงร่างตัวกรองกับแผ่นงานอื่น ๆ ); การเรียงลำดับขั้นสูง ตามเดือน / สัปดาห์ / วันความถี่และอื่น ๆ ตัวกรองพิเศษ โดยตัวหนาตัวเอียง ...
  • รวมสมุดงานและแผ่นงาน; ผสานตารางตามคอลัมน์สำคัญ แยกข้อมูลออกเป็นหลายแผ่น; Batch แปลง xls, xlsx และ PDF...
  • การจัดกลุ่มตาราง Pivot ตาม จำนวนสัปดาห์วันในสัปดาห์และอื่น ๆ ... แสดงปลดล็อกเซลล์ที่ถูกล็อก ด้วยสีที่ต่างกัน เน้นเซลล์ที่มีสูตร / ชื่อ...
kte แท็บ 201905
  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
ด้านล่าง officetab
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have column "A" listed with various Part nos. Say 50 parts. Each of these 50 parts will be repeated more than once. I column B where in for each of these part nos stock qty say for particular part no 1000 is the qty. This 1000 Qty is shown againt that particular part no in whichever cell it comes in column 'A".

The problem i am facing is sum total of column B is not correct as stock qty is shown n-number of times that particular part finds place in column A.

How do i avoid totaling up this repeated stock qty of one unique part. Say part no P1001 stock is 1000nos. If delivery date of this part P1001 is

Part no..Date.............Qty......Stock
P1001....05-10-22 .....150......1000
P1001....06-10-22......200.....1000
P1001....07-10-22.......250.....1000

in the above table stock is only 1000 but it shows against each delivery date the same stock qty. But when i want to sum the total stock of all part nos it should not take 1000 3 times but only 1 time. How do this?
This comment was minimized by the moderator on the site
Hello, Pugazh
Did you want to sum only the unique stock based on the part number?
Or you can give your problem as a creenshot here, so that, we can understand more clearly.
Thank you!
This comment was minimized by the moderator on the site
Hi,

I was wondering if there was a formula for three criteria? Or if there's a process/logic to follow for more than two criteria ?

Many thanks,
Gus
This comment was minimized by the moderator on the site
Hello, Gus,
If there are three criteria of your data, to sum the unique values, please apply the below array formula:
=SUM(IF(FREQUENCY(IF($A$2:$A$10=F2,IF($B$2:$B$10=G2,IF($C$2:$C$10=H2,MATCH($D$2:$D$10,$D$2:$D$10,0)))),ROW($D$2:$D$10)-ROW($C$2)+1),$D$2:$D$10))

After inserting the formula, please press press Ctrl + Shift + Enter keys together to get the result. see below screenshot:
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-sum-unique.png
Please have a try, thank you!
This comment was minimized by the moderator on the site
Hi,
I would like to sum based on two unique criteria, is this possible?
In the second example, rather than James and October being the specific criteria, James would stay the specific element, and the formula would sum based on the name and the month being unique.
Many thanks
Louise
This comment was minimized by the moderator on the site
Hola me podrias ayudar deseo sumar o contar solo valores unicos de fechas especificas me puedes ayudar ya que la formula =SUM(IF(FREQUENCY(IF($A$2:$A$12=D2,MATCH($B$2:$B$12,$B$2:$B$12,0)),ROW($B$2:$B$12)-ROW($B$2)+1),$B$2:$B$12)) me sirve pero como esta en ingles no se como colocarla, te agradezco mucho
This comment was minimized by the moderator on the site
Hello Jorge,

Formula: =SUM(IF(FREQUENCY(IF($A$2:$A$12=E2,IF($B$2:$B$12=F2,MATCH($C$2:$C$12,$C$2:$C$12,0))),ROW($C$2:$C$12)-ROW($C$2)+1),$C$2:$C$12))

Translate the English version formula into the Spanish version:
=SUMA(SI(FRECUENCIA(SI($A$2:$A$12=E2,SI($B$2:$B$12=F2,COINCIDIR($C$2:$C$12,$C$2:$C$12,0))),FILA($C$2:$C$12)-FILA($C$2)+1),$C$2:$C$12))

Please have a try.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
This doesn't actually work as I would have expected. The formula is only counting the unique criteria.

James had 700 units ordered in the first example, yet the total says 600.

The formula won't count his orders that contain the same qty because they are unique. Is there a way to modify this formula so you can get an actual total of all of James' orders?

The second formula has the same issue. James ordered 400 units, not 300 as shown in the summary. 
This comment was minimized by the moderator on the site
Hello, kc, May be the below article can solve your problem, please try:https://www.extendoffice.com/documents/excel/2471-excel-sumif-multiple-criteria.html
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations