跳到主要內容

如何在Excel中的日期中增加營業/工作天數或營業時間?

您可能需要在日期中添加多個工作日或工作時間,以了解在工作時間內完成任務的確切時間。 在本文中,我們將向您展示在Excel中向日期添加業務/工作天數或小時數的方法。

使用公式將工作日數添加到日期

使用公式將營業時間數添加到日期


使用公式將工作日數添加到日期

假設日期2016/1/5位於單元格A2上,如果您只想添加12天(包括工作日,不包括週末),請執行以下操作。

1.選擇一個空白單元格,輸入公式 = WORKDAY(A2,12)配方欄,然後按 Enter 鍵。 看截圖:

然後,您將在添加12個工作日後獲得日期。

筆記:

1.在公式中,A2是包含要添加工作日的日期的單元格,12是要添加到該日期的工作日的數目。 請根據需要更改它們。

2.使用上面的公式,您將獲得不包括週末在內的結果。 但計算後可能包括一些假期。 如果您想排除週末和節假日,請應用此公式 = WORKDAY(A2,B2,C2).

doc將工作時間天數添加到日期1

在此公式中,A2包含要向其添加工作日的日期,B2包含工作日的數量,C2定位休假的日期。

3.應用公式後,如果您獲得5位數字,請將單元格格式轉換為日期格式。


使用公式將營業時間數添加到日期

假設您具有開始日期和時間,需要添加的工作時間數,工作時間的開始和結束時間以及要排除的假期,如下面的屏幕快照所示。 要增加日期的營業時間,請執行以下操作。

doc將工作時間天數添加到日期1

1.選擇一個空白單元格(例如單元格C2),在公式欄中輸入以下公式,然後按 Enter 鍵。

=WORKDAY(A2,INT(B2/8)+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>
$F$2,1,0),$G$2:$G$2)+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>$F$2,$E$2
+TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)-$F$2,TIME(HOUR(A2),MINUTE(A2),SECOND(A2))
+ TIME(MOD(B2,8),MOD(MOD(B2,8),1)* 60,0))

然後您可以看到結果,如下圖所示。

doc將工作時間天數添加到日期1

筆記:

1.在公式中,A2是包含日期的單元格,B2是要添加到日期的工作時間,E2和F2是工作時間的開始和結束時間,$ G $ 2是特定的假期日期。 您可以根據需要進行更改。

2.如果在應用此公式後得到數字,請將單元格格式更改為日期和時間格式。

最佳辦公生產力工具

🤖 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 (22)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I have copy and pasted the formula below from the Add Number Of Business Hours To A Date With Formula step above. What is the equivalent formula where you could start with an end date and work backwards to the start date (instead of starting with the start date to find the end date).

=WORKDAY(A2,INT(B2/8)+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>
$F$2,1,0),$G$2:$G$2)+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>$F$2,$E$2
+TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)-$F$2,TIME(HOUR(A2),MINUTE(A2),SECOND(A2))
+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0))
This comment was minimized by the moderator on the site
This should be a simple one for you guys but I am working in a dealership and trying to create a simple formula that will automatically calculate how many working days we have in a month... example (6 days a week, because we work every Saturday but we are closed every Sunday). Thanks in advance for your help.
This comment was minimized by the moderator on the site
Hi Joshua Player,
For example, you need to count the number of working days in semptember including every Saturday. You need to do as follows:
1. Enter the start date and the end date of September in different cells, such as the start date 9/1/2022 in B1 and the last date 9/30/2022 in B2.
2. Apply one of the following formulas.
If you don't need to exclude holidays, apply this formula and press the Enter key to get the result:
=SUMPRODUCT(--(TEXT(ROW(INDIRECT(B1&":"&B2)),"dddd")<>"Sunday"))
If you need to exclude holidays (suppose the holiday dates listed in B3:C3), apply this formula and press the Ctrl + Shift + Enter keys to get the result
=SUMPRODUCT(--(TEXT(ROW(INDIRECT(B1&":"&B2)),"dddd")<>"Sunday"))-SUMPRODUCT(--IF((B3:C3>=B1)*(B3:C3<=B2),(TEXT(B3:C3,"dddd")<>"Sunday"), FALSE))
This comment was minimized by the moderator on the site
Hello Everyone,

Add Number Of Business Hours To A Date With Formula

I am not an expert but it gives me an error, everytime I insert the formula on the C2 cell. I followed all the instructions.
I have already formated all cells to time and date but still get an error saying that the formula contains an error.
Can someone explain or upload or send me an excel file with the formula already prepared?
Thanks in advance
This comment was minimized by the moderator on the site
Hi Renato,
Can you provide a screenshot of the formula error you encountered? Here I upload an Excel workbook with the formula prepared. Please download it and have a try.
This comment was minimized by the moderator on the site
Hi Crystal,

Thank you so much! I have downloaded the excel workbook and now it works.
Thanks again!
This comment was minimized by the moderator on the site
Good afternoon Sir,

How to get end date and time if i have start day and time together and to add "n" working hours excluding non working hours.

example 1) if start date=02/06/2022 02:00 and to add 4:00 working hours and the working hours are from 08:00 to 18:00 and the non working hours to be excluded are of from 18:00 to 08:00 and the end date should be like 02/06/2022 12:00. what is the formula for this one sir.
2) if start date=02/06/2022 16:00 and to add 4:00 working hours and the working hours are from 08:00 to 18:00 the and the non working hours to be excluded are of from 18:00 to 08:00 and the end date should be like 03/06/2022 10:00. what is the formula for this one sir.

In CCC to be completed time also same formula given sir.

Can u please help me with the formula sir?
This comment was minimized by the moderator on the site
How Can I add hours with working date+time. For E.g, This is the time 20/10/21 8:00am and I need to add hours with in working days and I need to add 4 hours(assume), and there are working hours between 08:00 to 05:00 and there are no holidays. How to add?
This comment was minimized by the moderator on the site
Hi, Supposing your case as shown in the screenshot below, to get a future date and time that falls within specified working hours, please try this formula:<div data-tag="code">=WORKDAY(A2,INT(B2/8)+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>$E$2,1,0))+IF(TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)>$E$2,$D$2+TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0)-$E$2,TIME(HOUR(A2),MINUTE(A2),SECOND(A2))+TIME(MOD(B2,8),MOD(MOD(B2,8),1)*60,0))
This comment was minimized by the moderator on the site
the formula adding work hours works mathwise, but it wont display the accurate time, just says 0:00. anyone know why?
This comment was minimized by the moderator on the site
can some help me to get a formula for below condition
I am unable to get the time , If i do =WORKDAY.INTL(A2,B2,1) ---Output is : Deal Date: 9/11/2018 0:00, Where the time is not coming up, As time should come with 18:34 PM

A2: Deal Date :9/7/2018 18:34 PM
B2: Days: 2
Output is :New Deal Date: 9/11/2018 0:00

Required Output is 9/11/2018 18:34 PM - Plz help me with the formula!
--------------------
9/7/2018 - Friday , I need to add 2 days excluding weekends, So if i add 2 days to 9/7/2018(Friday ) its Tuesday (9/11/2018) by removing the Sat & Sun.
This comment was minimized by the moderator on the site
Hi Harish,
Sorry can't help you with that yet. Thanks for your comment.
This comment was minimized by the moderator on the site
How to add a cell in the excel says that maximum hours per day (i.e., 8 hours) The time calculation to be bound by 8 hours per day. Please help me if we can have the spread sheet cap the calculation at 8.?
This comment was minimized by the moderator on the site
How to get cells in excel formula (H6; H7; H8; H9)
Forma C2 = =WORKDAY(B2;MAX(ROUNDUP((E2-IF((COUNTIF($J$4:$J$91;INT(B2))=0)*(WEEKDAY(B2;2)<=5);IF(MOD(B2;1)>$H$3;0;IF(MOD(B2;1)>=$H$5;(H3-MOD(B2;1))*24;($H$3-MAX(MOD(B2;1);$H$2)-($H$5-MAX(MOD(B2;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);0);0);$J$4:$J$91)+$H$2+(IFERROR(CEILING(MOD((E2-IF((COUNTIF($J$4:$J$91;INT(B2))=0)*(WEEKDAY(B2;2)<=5);IF(MOD(B2;1)>$H$3;0;IF(MOD(B2;1)>=$H$5;($H$3-MOD(B2;1))*24;($H$3-MAX(MOD(B2;1);$H$2)-($H$5-MAX(MOD(B2;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);1)-0,00000001;0,00000001);1)*($H$3-$H$2-($H$5-$H$4))*24+(IFERROR(CEILING(MOD((E2-IF((COUNTIF($J$4:$J$91;INT(B2))=0)*(WEEKDAY(B2;2)<=5);IF(MOD(B2;1)>H3;0;IF(MOD(B2;1)>=$H$5;($H$3-MOD(B2;1))*24;($H$3-MAX(MOD(B2;1);$H$2)-($H$5-MAX(MOD(B2;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);1)-0,00000001;0,00000001);1)*($H$3-$H$2-($H$5-$H$4))*24>($H$4-$H$2)*24)*($H$5-$H$4)*24)/24

and C3 = =WORKDAY(B3;MAX(ROUNDUP((E3-IF((COUNTIF($J$4:$J$91;INT(B3))=0)*(WEEKDAY(B3;2)<=5);IF(MOD(B3;1)>$H$3;0;IF(MOD(B3;1)>=$H$5;(H4-MOD(B3;1))*24;($H$3-MAX(MOD(B3;1);$H$2)-($H$5-MAX(MOD(B3;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);0);0);$J$4:$J$91)+$H$2+(IFERROR(CEILING(MOD((E3-IF((COUNTIF($J$4:$J$91;INT(B3))=0)*(WEEKDAY(B3;2)<=5);IF(MOD(B3;1)>$H$3;0;IF(MOD(B3;1)>=$H$5;($H$3-MOD(B3;1))*24;($H$3-MAX(MOD(B3;1);$H$2)-($H$5-MAX(MOD(B3;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);1)-0,00000001;0,00000001);1)*($H$3-$H$2-($H$5-$H$4))*24+(IFERROR(CEILING(MOD((E3-IF((COUNTIF($J$4:$J$91;INT(B3))=0)*(WEEKDAY(B3;2)<=5);IF(MOD(B3;1)>H4;0;IF(MOD(B3;1)>=$H$5;($H$3-MOD(B3;1))*24;($H$3-MAX(MOD(B3;1);$H$2)-($H$5-MAX(MOD(B3;1);$H$4)))*24));0))/(($H$3-$H$2-($H$5-$H$4))*24);1)-0,00000001;0,00000001);1)*($H$3-$H$2-($H$5-$H$4))*24>($H$4-$H$2)*24)*($H$5-$H$4)*24)/24
But the correct value is in D2 and D3. How to get it?
This comment was minimized by the moderator on the site
IF WE HAVE TO WRITE THE SAME FORMULA WITH WORKDAY.INTL THAN HOW TO WRITE IT
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