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

วิธีการเฉลี่ยตามวันในสัปดาห์ใน Excel

doc-เฉลี่ยรายสัปดาห์-1

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

คำนวณค่าเฉลี่ยตามวันในสัปดาห์ด้วยสูตร


ลูกศรสีฟ้าฟองขวา คำนวณค่าเฉลี่ยตามวันในสัปดาห์ด้วยสูตร

คำนวณค่าเฉลี่ยตามวันที่ระบุในสัปดาห์

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

โปรดป้อนสูตรนี้: =AVERAGE(IF(WEEKDAY(D2:D15)=2,E2:E15)) ลงในเซลล์ว่างจากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันเพื่อให้ได้ผลลัพธ์ที่ถูกต้อง ดูภาพหน้าจอ:

doc-เฉลี่ยรายสัปดาห์-2

หมายเหตุ ในสูตรข้างต้น:

D2: D15 คือช่วงวันที่ที่คุณอ้างอิง

จำนวน 2 บ่งชี้ว่า วันจันทร์และ 1 = วันอาทิตย์ 3 = วันอังคาร 4 = วันพุธ…คุณสามารถเปลี่ยนหมายเลข 2 ได้ตามต้องการ

E2: E15 หมายถึงช่วงข้อมูลที่คุณต้องการหาค่าเฉลี่ย

เคล็ดลับ: สูตรต่อไปนี้สามารถช่วยคุณแก้ปัญหานี้ได้: =SUMPRODUCT((WEEKDAY(D2:D15,2)=1)*E2:E15)/SUMPRODUCT((WEEKDAY(D2:D15,2)=1)*1) และเพียงแค่กด เข้าสู่ กุญแจสำคัญในการรับผลลัพธ์ (D2: D15 คือช่วงวันที่ที่คุณอ้างอิง E2: E15 หมายถึงช่วงข้อมูลที่คุณต้องการหาค่าเฉลี่ยตัวเลข 1 บ่งชี้ว่า วันจันทร์, 2 = วันอังคาร, 3 = วันพุธ ... )


คำนวณค่าเฉลี่ยตามวันทำงาน

หากคุณต้องการเฉลี่ยคำสั่งซื้อกับวันทำงานทั้งหมดในช่วงนั้นโปรดใช้สูตรนี้: =AVERAGE(IF(WEEKDAY(D2:D15,2)={1,2,3,4,5},E2:E15))จากนั้นกด Shift + Ctrl + Enter คีย์เข้าด้วยกันและคุณจะได้รับคำสั่งซื้อโดยเฉลี่ยตั้งแต่วันจันทร์ถึงวันศุกร์

doc-เฉลี่ยรายสัปดาห์-3

หมายเหตุ:

1. นี่เป็นอีกสูตรหนึ่งที่คุณอาจชอบ:=SUMPRODUCT((WEEKDAY(D2:D15,2)<6)*E2:E15)/SUMPRODUCT((WEEKDAY(D2:D15,2)<6)*1) และกด เข้าสู่ กุญแจ

2. ในสูตรข้างต้น: D2: D15 คือช่วงวันที่ที่คุณอ้างอิงและ E2: E15 หมายถึงช่วงข้อมูลที่คุณต้องการหาค่าเฉลี่ย


คำนวณค่าเฉลี่ยตามวันหยุดสุดสัปดาห์

และหากคุณต้องการเฉลี่ยคำสั่งซื้อในช่วงสุดสัปดาห์ (วันเสาร์และวันอาทิตย์) สูตรต่อไปนี้อาจช่วยคุณได้:

กรุณาพิมพ์สูตรนี้: =AVERAGE(IF(WEEKDAY(D2:D15,2)={6,7},E2:E15)) ลงในเซลล์ว่างเฉพาะแล้วกด Shift + Ctrl + Enter คีย์พร้อมกันจากนั้นคุณจะได้รับคำสั่งซื้อเฉลี่ยในช่วงสุดสัปดาห์เท่านั้น ดูภาพหน้าจอ:

doc-เฉลี่ยรายสัปดาห์-4

หมายเหตุ:

1. คุณยังสามารถใช้สูตรด้านล่างเพื่อแก้ปัญหานี้: =SUMPRODUCT((WEEKDAY(D2:D15,2)>5)*E2:E15)/SUMPRODUCT((WEEKDAY(D2:D15,2)>5)*1) แล้วกดปุ่ม Enter

2. ในสูตรข้างต้น: D2: D15 คือช่วงวันที่ที่คุณอ้างอิงและ E2: E15 หมายถึงช่วงข้อมูลที่คุณต้องการหาค่าเฉลี่ย


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

วิธีคำนวณค่าเฉลี่ยระหว่างวันที่สองวันใน Excel

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

วิธีการเฉลี่ยค่า 3 อันดับบนหรือล่างใน 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 (13)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have some data, that is in one day i have some order and with different quantity, how do i get the formula for average quantity in one singel date?
This comment was minimized by the moderator on the site
12-Dec-22 1 Week 51 Mon W-Day 86.85
13-Dec-22 1 Week 51 Tue W-Day 83.57
14-Dec-22 1 Week 51 Wed W-Day 89.67
15-Dec-22 1 Week 51 Thu W-Day 89.67
16-Dec-22 1 Week 51 Fri W-Day 85.45
17-Dec-22 1 Week 51 Sat PH 80.28
18-Dec-22 1 Week 51 Sun FH 85.45

I want the above data average for monday to friday(W-Day) average ,Saturday(PH) and Sunday(FH) average
This comment was minimized by the moderator on the site
Hello, Manigandan
If you need to average from Monday to Friday and average from Saturday and Sunday, please apply the below formulas:
Average from Monday to Friday: =AVERAGE(IF(WEEKDAY(A2:A8,2)={1,2,3,4,5},D2:D8))
Average from Saturday and Sunday: =AVERAGE(IF(WEEKDAY(A2:A8,2)={6,7},D2:D8))
Note: Both the above fromulas are array formulas, please press Shift + Ctrl + Enter keys together to get the correct result.
https://www.extendoffice.com/images/stories/comments/comment-skyyang/2023-comment/doc-average-workdays.png

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
How do I get my formula to work with it not taking zeros into the average?
=AVERAGE(IF(WEEKDAY($B$4:$B$34,2)={1,2,3,4,5},C4:C34))
This comment was minimized by the moderator on the site
Hello, Phil,
To get the average while skip the zeros, the following formula may help you:
=AVERAGE(IF((WEEKDAY($B$2:$B$14,2)<6)*($C$2:$C$14<>0)=1,$C$2:$C$14))

After pasting the formula, please press Ctrl + Shift + Enter keys together to get the result.

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Yes, this works. Why does it work with such a large RANGE and not just for the number of days in a month?

Doing it my other way I had to manually change the formula's each month. THANK YOU 😀👊
This comment was minimized by the moderator on the site
I have this formula; {=AVERAGE(IF(WEEKDAY(I12:I25,2)={1,2,3,4,5},J12:J25))} the range: i12:i25(col 1 is the month date series) and j12:j25(col of values to be averaged) will change each day
11/1/2022 57
11/2/2022 45
11/3/2022 58
11/4/2022 51
11/5/2022 56
11/6/2022 65
11/7/2022 79
11/8/2022 80
11/9/2022 56
11/10/2022 60
11/11/2022 51
11/12/2022 59
11/13/2022 79
11/14/2022 76
11/15/2022 76
11/16/2022
11/17/2022
11/18/2022
11/19/2022
11/20/2022
11/21/2022
11/22/2022
11/23/2022
11/24/2022
11/25/2022
11/26/2022
11/27/2022
11/28/2022
11/29/2022
11/30/2022
12/1/2022
12/2/2022

Avg / M-F 61.3 < formula is here {=AVERAGE(IF(WEEKDAY(I12:I25,2)={1,2,3,4,5},J12:J25))}
avg # active each workday

how do i update the 2 ranges every day without manually changing them?
This comment was minimized by the moderator on the site
Hello, Daniel
To solve your problem, you just need to adjust the cell references large as this:
=AVERAGE(IF(WEEKDAY(I12:I100000,2)={1,2,3,4,5},J12:J100000))
Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
if I use your formula for just weekends...=AVERAGE(IF(WEEKDAY(I12:I100000,2)={6,7},J12:J100000)) the value comes up as "0.0"
This comment was minimized by the moderator on the site
Hello, Daniel
Sorry, the above formula is not correct, plrase use the below formulas:
Average weekend: =AVERAGE(IF(IF(NOT(ISBLANK(B2:B10000)),WEEKDAY(A2:A10000,2)>5,FALSE),B2:B10000,FALSE))
Average workday: =AVERAGE(IF(IF(NOT(ISBLANK(B2:B10000)),WEEKDAY(A2:A10000,2)<6,FALSE),B2:B10000,FALSE))

Note: Both the formulas are array formulas, please press Ctrl + Shift + Enter keys together to get the result.

Please try, thank you!
This comment was minimized by the moderator on the site
I have this formula; {=AVERAGE(IF(WEEKDAY(I12:I25,2)={1,2,3,4,5},J12:J25))} the range: i12:i25(col 1 is the month date series) and j12:j25(col of values to be averaged) will change each day
11/1/2022 57
11/2/2022 45
11/3/2022 58
11/4/2022 51
11/5/2022 56
11/6/2022 65
11/7/2022 79
11/8/2022 80
11/9/2022 56
11/10/2022 60
11/11/2022 51
11/12/2022 59
11/13/2022 79
11/14/2022 76
11/15/2022 76
11/16/2022
11/17/2022
11/18/2022
11/19/2022
11/20/2022
11/21/2022
11/22/2022
11/23/2022
11/24/2022
11/25/2022
11/26/2022
11/27/2022
11/28/2022
11/29/2022
11/30/2022
12/1/2022
12/2/2022

Avg / M-F 61.3 < formula is here {=AVERAGE(IF(WEEKDAY(I12:I25,2)={1,2,3,4,5},J12:J25))}
avg # active each workday

how do i update the 2 ranges every day without manually changing them?
This comment was minimized by the moderator on the site
I found what I needed, why the Cntl Shift Enter to make formula work?
This comment was minimized by the moderator on the site
How is it that in the first formula 1 is Sunday but in the second and third formula 7 is Sunday??
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations