https://www.banggood.com/50X-LED-Illumination-Pen-Style-Pocket-Microscope-Magnifying-Glass-with-Reading-Scales-p-1137785.html?p=8Z020971524652016114

MS Excel - How to sum with multiple criteria - การบวกตัวเลขแบบมีหลายเงื่อนไข








MS Excel - How to sum with multiple criteria - การบวกตัวเลขแบบมีหลายเงื่อนไข




การบวกตัวเลขโดยมีหลายเงื่อนไข 
มีหลายกรณีที่ผู้ใช้ต้องการสร้างแบบฟอร์มรายงานด้วยไมโครซอฟต์ เอกซ์เซล โดยมีการนำข้อมูลจากแหล่งข้อมูลอื่น เช่น รายงานที่ส่งออกจากระบบอื่น นำมาวางในแบบฟอร์ม เอกซ์เซล ที่สร้างไว้ โดยข้อมูลดังกล่าวเป็นข้อมูลที่มีลักษณะเดียวกัน มีการจัดเรียงในรูปแบบเดียวกัน (ดังตัวอย่างที่ใช้ในบทความนี้) โดยผู้ดูรายงานต้องการดูยอดรวมตามเงื่อนไข ที่กำหนด แต่ในขณะเดียวกัน ก็ยังต้องการดูข้อมูลที่จัดเรียงในรูปแบบเดิมที่ได้จากแหล่งข้อมูลที่นำมา

เช่น มีข้อมูลการซื้อสินค้าของลูกค้า จัดเรียงตามชื่อลูกค้า แต่ละลูกค้ามีการจัดแบ่งตาม ชนิดสินค้า ผู้จำหน่ายสินค้า และพื้นที่ที่จัดส่งสินค้า โดยแยกเป็นคอลัมน์

ในกรณีนี้สามารถใช้สูตร 

sumifs(คอลัมน์ที่ต้องการรวมตัวเลข, คอลัมน์ที่เป็นเงื่อนไขที่ 1, "เงื่อนไขที่ 1", คอลัมน์ที่เป็นเงื่อนไขที่ 2, "เงื่อนไขที่ 2")

SUMIFS(sum_range, criteria_range1, criteria1, ...)

*สามารถใส่เงื่อนไขได้มากกว่า 1 โดยในแต่ละคอลัมน์กำหนดได้ 1 เงื่อนไข

ตัวอย่างเงื่อนไข
ผู้ใช้ต้องการดูยอดรวมของลูกค้าที่ซื้อสินค้าประเภท Snacks จาก ผู้จำหน่ายสินค้าชื่อ Thai CS โดยมีพื้นที่ส่งสินค้าที่ Bkk
Product Type = Snacks
Supplier = Thai CS
Location = Bkk
สูตรที่ใช้คือ
=SUMIFS(F4:F21,C4:C21,"Snacks",D4:D21,"Thai CS",E4:E21,"Bkk")

ดูตัวอย่างโดยละเอียดด้านล่างนี้ครับ

================================================

How to sum with multiple criteria.
There are many situations that you want to create a template on Excel then copy data from the other source like another Exel file which always have the same data pattern (same number of column and sequencing of data). Then you want to have the sum of the amount with multiple criteria from the data.

In this case, you can use the formula SUMIFS(sum_range, criteria_range1, criteria1, ...)

Please find the example below.

================================================

ตัวอย่างโดยละเอียดมีดังนี้ - Please find the example below.
1.เตรียมข้อมูล โดยจากตัวอย่าง ตัวเลขที่ต้องการรวมอยู่ใน คอลัมน์ F เริ่มตั้งแต่ เซลล์ F4 จนถึงเซลล์ F21

1.Preparing data in an Excel sheet. In this example, I plan to sum the mount on the F column (F4 to F21).



2.ต้องการรวมตัวเลข โดยมีเงื่อนไขคือยอดรวมของลูกค้าที่ซื้อสินค้าประเภท Snacks จาก ผู้จำหน่ายสินค้าชื่อ Thai CS โดยมีพื้นที่ส่งสินค้าที่ Bkk
Product Type = Snacks (คอลัมน์ C)
Supplier = Thai CS (คอลัมน์ D)
Location = Bkk (คอลัมน์ E)

2.In this example, I would like to sum for the customer name who purchased snacks from the supplier name Thai CS and has a delivery location in Bangkok. (The criteria as below).
Product Type = Snacks (Column C)
Supplier = Thai CS (Column D)
Location = Bkk (Column E)

3.จัดหาพื้นที่สำหรับให้แสดงผลและใส่สูตร ส่วนใหญ่ในการใช้สูตรทำนองนี้ จะเหมาะสำหรับการทำเป็นรูปแบบฟอร์มรายงาน ที่ผู้ใช้จะคัดลอกข้อมูลจากไฟล์ข้อมูลอื่นมาวางทับในภายหลัง เช่น ในทุกๆ สิ้นวัน หรือ ทุกสัปดาห์ 
ในตัวอย่างนี้เราจะใช้สูตร 
=SUMIFS(F4:F21,C4:C21,"Snacks",D4:D21,"Thai CS",E4:E21,"Bkk")

อธิบายเงื่อนไขในสูตร
F4:F21 คือพื้นที่ที่จะมีการนำตัวเลขมารวม
C4:C21 คือพื้นที่สำหรับตรวจสอบเงื่อนไขที่ 1 ที่มีประเภทสินค้าเป็น "Snacks"
D4:D21 คือพื้นที่สำหรับตรวจสอบเงื่อนไขที่ 2 ที่มีผู้ขายเป็น "Thai CS"
E4:E21 คือพื้นที่สำหรับตรวจสอบเงื่อนไขที่ 3 ที่มีพื้นที่จัดส่งเป็น "Bkk"

3.Preparing an area to display the result as a template. Then use the formula
=SUMIFS(F4:F21,C4:C21,"Snacks",D4:D21,"Thai CS",E4:E21,"Bkk")

Please find an explanation of the formula below.
F4:F21 is the range that I planned to sum the amount.
C4:C21 is the range to find the first criteria which is "Snacks".
D4:D21 is the range to find the second criteria which is "Thai CS".
E4:E21 is the range to find the third criteria which is "Bkk".
 




MS Excel - การบวกตัวเลขแบบมีหลายเงื่อนไข - How to sum with multiple criteria.

Previous
Next Post »