跳到主要內容

如何在Excel中根據星期幾取平均值?

文檔平均每週 1

在Excel中,您是否嘗試過根據一周中的哪一天計算列表編號的平均值? 假設我具有以下數據范圍,現在我想獲取所有星期一,工作日或週末的平均訂單。 本文,我將介紹一些公式來幫助您解決此任務。

使用公式計算基於星期幾的平均值


箭頭藍色右氣泡 使用公式計算基於星期幾的平均值

根據一周中的特定日期計算平均值

要獲取基於一周中特定日期的平均值,以下公式可能會對您有所幫助。 在此示例中,我將計算數據范圍中星期一的平均訂單,請執行以下操作:

請輸入以下公式: =AVERAGE(IF(WEEKDAY(D2:D15)=2,E2:E15)) 放入空白單元格,然後按 Shift + Ctrl + 輸入 鍵在一起以獲得正確的結果。 看截圖:

文檔平均每週 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) 然後按 Enter 獲得結果的關鍵。 (D2:D15 是您基於的日期範圍, E2:E15 指您想要獲得平均值的數據范圍,數字 1 指示 星期一,2 =星期二,3 =星期三...)


根據工作日計算平均值

如果要對所有工作日的平均訂單進行平均,請使用以下公式: =AVERAGE(IF(WEEKDAY(D2:D15,2)={1,2,3,4,5},E2:E15)),然後按 Shift + Ctrl + 輸入 鍵,您將獲得周一至週五的平均訂單。

文檔平均每週 3

筆記:

這是另一個公式,可能對您有利:=SUMPRODUCT((WEEKDAY(D2:D15,2)<6)*E2:E15)/SUMPRODUCT((WEEKDAY(D2:D15,2)<6)*1) 並按下 Enter 鍵。

2.在以上公式中: D2:D15 是您基於的日期範圍,並且 E2:E15 指您想要獲得平均值的數據范圍。


根據周末計算平均值

而且,如果您只想平均週末(星期六和星期日)的訂單,則以下公式可能會對您有所幫助:

請輸入以下公式: =AVERAGE(IF(WEEKDAY(D2:D15,2)={6,7},E2:E15)) 放入特定的空白單元格,然後按 Shift + Ctrl + 輸入 同時輸入關鍵字,然後您將僅在周末獲得平均訂單。 看截圖:

文檔平均每週 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中基於多個條件對單元格求平均?

如何在Excel中平均前3個值?

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為Office帶來了選項卡式界面,使您的工作更加輕鬆

  • 在Word,Excel,PowerPoint中啟用選項卡式編輯和閱讀,發布者,Access,Visio和Project。
  • 在同一窗口的新選項卡中而不是在新窗口中打開並創建多個文檔。
  • 將您的工作效率提高 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