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

วิธีการเฉลี่ยเซลล์ตามเกณฑ์ต่างๆใน Excel

ใน Excel พวกเราส่วนใหญ่อาจคุ้นเคยกับฟังก์ชัน COUNTIF และ SUMIF ซึ่งสามารถช่วยเราในการนับหรือรวมค่าตามเกณฑ์ได้ แต่คุณเคยพยายามคำนวณค่าเฉลี่ยตามเกณฑ์อย่างน้อยหนึ่งเกณฑ์ใน Excel หรือไม่?

เซลล์เฉลี่ยตามเกณฑ์เดียวด้วยฟังก์ชัน Averageif

เซลล์เฉลี่ยตามเกณฑ์หลายข้อพร้อมฟังก์ชัน Averageifs


ลูกศรสีฟ้าฟองขวา เซลล์เฉลี่ยตามเกณฑ์เดียวด้วยฟังก์ชัน Averageif

สมมติว่าฉันมีช่วงข้อมูลต่อไปนี้คอลัมน์ A คือรายการผลิตภัณฑ์และคอลัมน์ B คือคำสั่งซื้อตอนนี้ฉันจะเฉลี่ยเซลล์คำสั่งซื้อที่ผลิตภัณฑ์คือ KTE

doc-avergae กับเกณฑ์ -1

กรุณาใส่สูตรนี้ลงในเซลล์ที่คุณต้องการ: =AVERAGEIF(A2:A19,D2,B2:B19), (A2: A19 คือข้อมูลที่มีเกณฑ์ B2: B19 หมายถึงช่วงที่คุณต้องการเฉลี่ยและ D2 คือเกณฑ์ที่คุณต้องการเฉลี่ยค่าตาม) แล้วกด เข้าสู่ กุญแจสำคัญในการรับผลลัพธ์ดูภาพหน้าจอ:

doc-avergae กับเกณฑ์ -2


ลูกศรสีฟ้าฟองขวา เซลล์เฉลี่ยตามเกณฑ์หลายข้อพร้อมฟังก์ชัน Averageifs

หากคุณต้องการคำนวณค่าเฉลี่ยโดยใช้หลายเกณฑ์ค่า เฉลี่ย ฟังก์ชันอาจช่วยคุณได้

ไวยากรณ์ Averageifs ดังต่อไปนี้:

AVERAGEIFS (ช่วงเฉลี่ย, ช่วงเกณฑ์ 1, เกณฑ์ 1, ช่วงเกณฑ์ 2, เกณฑ์ 2 …)

  • ค่าเฉลี่ย_ช่วง: คือช่วงของเซลล์ที่จะหาค่าเฉลี่ย
  • เกณฑ์_ช่วง1, ช่วงเกณฑ์ 2, ... เป็นช่วงที่ใช้ประเมินเกณฑ์ที่เกี่ยวข้อง
  • เกณฑ์ 1, เกณฑ์ 2, …เป็นเกณฑ์ที่คุณยึดตาม

ยกตัวอย่างข้อมูลข้างต้นตอนนี้ฉันต้องการเฉลี่ยลำดับของ KTE และคำสั่งซื้อที่มากกว่า 500 โปรดทำตามนี้:

ป้อนสูตรนี้ลงในเซลล์ว่าง: =AVERAGEIFS(B2:B19,A2:A19,E1,B2:B19,">500")( A2: A19 คือข้อมูลที่มีเงื่อนไข 1 B2: B19 หมายถึงช่วงที่คุณต้องการเฉลี่ย E1 และ > 500 คือเกณฑ์ 1 และเกณฑ์ 2) จากนั้นกด เข้าสู่ กุญแจสำคัญในการรับผลลัพธ์ที่คุณต้องการ ดูภาพหน้าจอ:

doc-avergae กับเกณฑ์ -3

หมายเหตุ หากคุณมีเกณฑ์มากกว่าสองเกณฑ์ที่คุณต้องการคุณเพียงแค่เพิ่มช่วงเกณฑ์และเกณฑ์ที่คุณต้องการดังนี้: = AVERAGEIFS (C2: C19, A2: A19, F1, B2: B19, F2, C2: C19, "<500"), (A2: A19 และ F1 เป็นช่วงเกณฑ์แรกและเกณฑ์ B2: B19 และ F2 เป็นช่วงเกณฑ์และเกณฑ์ที่สอง C2: C19 และ <500 เป็น ที่สาม ช่วงเกณฑ์และเกณฑ์ C2: C19 หมายถึงช่วง เธอ ต้องการเฉลี่ยค่า) ดูภาพหน้าจอ:

doc-avergae กับเกณฑ์ -4


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

วิธีการเฉลี่ยค่า 3 อันดับบนหรือล่างใน Excel

วิธีการเฉลี่ย 5 ค่าสุดท้ายของคอลัมน์เมื่อป้อนตัวเลขใหม่

วิธีการเฉลี่ยทุกๆ 5 แถวหรือคอลัมน์ใน 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 (16)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, I'm trying to create an average only if the row meets criteria in other columns. I need to only include the number in column J if that row has a "B" in column F and a "M" in column E. I've worked out the formula if it's only one condition:

=AVERAGEIF(F2:F114, "B", J2:J114)

But I can't work out how to get it to only average numbers in column J that meet both conditions?
This comment was minimized by the moderator on the site
Hello, Sally
To calculate the average based on multiple criteria, you can apply the AVERAGEIFS function, please use the below formula:
=AVERAGEIFS(J2:J114, F2:F114, "B", E2:E114, "M" )

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Thanks so much, this worked perfectly!
This comment was minimized by the moderator on the site
What formula would I use if I wanted to get my averages for a month but not count the days that are zero (0)? I am keeping track of my monthly electric usage but need to get an average even before the end of the months. Any ideas or help?
This comment was minimized by the moderator on the site
Hello, TFkidd
To solve your problem, please apply the below formula:
=AVERAGE(IF(B2:B31<>0,B2:B31))
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi there
I am trying to calculate percentage of people from across 4 regions (entered in column b)
and percentage by ethnicity (entered in column D)
I can calculate the average age and percentage of ages, but I can't seem to find a formula to calculate the regions and ethnicity. Any suggestions would be appreciated, thanks Tracy
This comment was minimized by the moderator on the site
To get an average of data in a column with multiple criteria the following formulae may be used.

Syntax = AVERAGEIFS (Range, Range 1, criteria 1, range 2, criteria 2)

In this case, my requirement is to find the average of the data in a range of numbers, without considering '0 - Zero' & values greater that '3000'.

Total data in the range is 31 nos ,

And the formulae will be

=AVERAGEIFS(G5:G35,G5:G35, "> 3000", G5:G35,"<>0")
This comment was minimized by the moderator on the site
I have 4 variables: 1st: Date of onset, 2nd: Date of termination, 3rd: Date of measurement, 4th: measurement. I want to calculate the average of the 4th variable between each period of onset-termination. How can i do it? I think its a bit tricky. Each date of onset has an counterpart date of termination. The same applies for the 3rd and 4th variable.
How can i make this happen?
This comment was minimized by the moderator on the site
VBA code to average one or more ranges of nonzero numbers:


Option Explicit
Function avgNonZeros(ParamArray rangeList() As Variant) As Variant
'Returns the average for all nonzeros of rangeList.
'rangeList may be one or multiple ranges.
Dim cell As Range
Dim i As Long
Dim totSum As Long
Dim cnt As Long
DoEvents 'allows calculations prior to performing
avgNonZeros = 0 'default return
For i = LBound(rangeList) To UBound(rangeList)
For Each cell In rangeList(i)
If cell <> 0 Then
totSum = totSum + cell
cnt = cnt + 1
End If
Next cell
Next i
If cnt <> 0 Then avgNonZeros = totSum / cnt
End Function
This comment was minimized by the moderator on the site
Hi,
I have 200 observations. I need to get an average of 21st to 40th observations. I am struggling to set an averageif formula. Any suggestion will be appreciated.
This comment was minimized by the moderator on the site
I have a similar problem like example #3, but the difference is that I need the average between two dates instead of for a single month. Any suggestion?
This comment was minimized by the moderator on the site
Hello, Crist,

To solve your problem, please apply the below formula:
=AVERAGEIFS(C2:C15, A2:A15, F1, B2:B15, ">=" &F2, B2:B15, "<=" &G2, C2:C15, ">300")

Please try, hope it can help you!
This comment was minimized by the moderator on the site
Hi there,


My is Pablo and I would like to ask you about this situation. I have got a column with several values and some of them are zeros. As they are dB measurements this is the array formula I use to get the average: =10*LOG(AVERAGE(10^(C3:C66/10)))

My problem is that I am trying to get with a formula that does not take in account the zeros.

I have tried the next formula but it seems that does not work for my situation: =10*LOG(AVERAGEif(C3:C66,"<>0",[10^(C3:C66/10)]))

It would be very apprecited if you could give me a hint to solve this problem.

Thank you in advance,

Pablo.
This comment was minimized by the moderator on the site
I want to take numbers in multiple columns and combine them into one average. I have three columns to average, I want two of the columns to count for 40% each and the remaining column to count for 20%. Is this possible? Thanks!
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