跳到主要內容

如何在Excel中添加或減去日期,月份和年份?

本文提供了7種解決方案,可以在Excel中向日期添加或減去天,週,月,年或年/月/日的組合。 視頻演示

  1. 用公式添加或減去日期
  2. 在沒有公式的情況下將日期加或減到多個日期
  3. 在Excel中添加或減去迄今為止的幾週
  4. 在Excel中添加或減去迄今的月份
  5. 在Excel中添加或減去迄今為止的年份
  6. 在Excel中添加或減去年,月和日的組合
  7. 用Kutools for Excel添加或減去日期,週,月或年至今

用公式添加或減去日期

您可能已經註意到,日期是Excel中的5位數字。 因此,您可以像在Excel中增加或減少天數一樣容易地增加或減少天數。

= 日期 + 天數

1。 選擇一個空白單元格,您將放置計算結果,鍵入公式 = A2 + 10,然後按 Enter 鍵。
備註:要從日期減去10天,請使用以下公式 = A2-10.

2。 如果需要將此公式應用於其他單元格,請根據需要將公式單元格的“自動填充”手柄拖到這些單元格上。

現在,您已從這些日期中批量添加或減去了相同的天數。 看截圖:

在Excel中輕鬆添加/減去日期,星期,月份或年份

難以記住Excel中冗長的複雜公式嗎? Kutools for Excel的 公式助手 列出最常用的公式,以幫助您快速計算和解決Excel中的問題。 加上年/月/週/日, 加上小時/分鐘/秒, 絕對值總和, 尋找最普遍的價值等等。


廣告添加天數週數年至今

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

在沒有公式的情況下將日期加或減到多個日期

與公式相比,某些Excel用戶更喜歡不使用公式直接增加或減少天數。 在這裡,我將指導您使用Excel中的“選擇性粘貼”功能從多個日期中添加或減去相同的天數。

1。 鍵入要在空白單元格中的日期上加上或減去的天數,說10,然後將其複制。 看截圖:

2。 選擇要增加或減少天數的日期,右鍵單擊並選擇 選擇性粘貼 > 選擇性粘貼 在上下文菜單中。 看截圖:

3。 在“選擇性粘貼”對話框中,請檢查 加入 or 減去 選項,然後單擊 OK 按鈕。 看截圖:

4。 現在,將數字添加或減去到日期,日期顯示為5位數字。 保持選中這些5位數字,然後單擊 首頁 > 數字格式 盒子> 短期約會 再次將它們轉換為日期。

現在,您將看到從指定的日期範圍中批量添加或減去指定的天數,而無需使用公式。 看截圖:

在Excel中添加或減去迄今為止的幾週

您還可以應用公式從Excel中的日期中添加或減去指定的星期數。 請執行以下操作:

= 日期 + 7 * 週數

1。 選擇要放置計算結果的空白單元格,鍵入公式 = A2 + 4 * 7,然後按 Enter 鍵。
備註:要從日期減去4週,請使用以下公式 = A2-4 * 7.

Excel的Kutools

在人群中脫穎而出

300+ 便利工具
解決 Excel 中 80% 的問題
立即免費試用

告別繁瑣的 VBA 和公式!

2。 如果需要從其他日期增加或減少幾週,請根據需要拖動公式單元格的“自動填充”手柄。

現在,您已從多個日期中批量添加或減去了相同的星期數。 看截圖:

在Excel中添加或減去迄今的月份

要在日期上加上或減去月份,則不宜在日期上加上或減去30,因為月份中一年中包含的天數不同,有些包含30天,有些包含31天,而有些則包含28或29天。 因此,我們需要應用EDATE函數來處理這種情況。

= EDATE(日期, 月數)

1。 選擇要放置計算結果的空白單元格,鍵入公式 = EDATE(A2,3),然後拖動此公式單元格的自動填充手柄以根據需要將此公式應用於其他單元格。
備註:要從日期減去3個月,請使用此公式 = EDATE(A2,-3).

2。 如您所見,EDATE函數將返回5位數字。 請保持選中這5位數字,然後單擊 首頁 > 數字格式 盒子> 短期約會 將其轉換為日期。 看截圖:

現在,您將看到它在批量日期中增加或減去了相同的月數。 看截圖:

在Excel中添加或減去迄今為止的年份

例如,您將在Excel中的一批日期中添加6年,可以執行以下操作:

= DATE(YEAR(日期)+ 年數,MONTH(日期),天(日期))

1。 選擇要放置計算結果的空白單元格,鍵入公式 = DATE(YEAR(A2)+ 6,MONTH(A2),DAY(A2)),然後按 Enter 鍵。
備註:要從日期中減去6年,請應用此公式 = DATE(YEAR(A2)-6,MONTH(A2),DAY(A2)).

2。 如果需要,請拖動公式單元格的“自動填充”手柄,以根據需要將此公式應用於其他單元格。

在Excel中添加或減去年,月和日的組合

在某些情況下,您可能需要同時添加或減去年,月和天,比如說添加3年5個月和15天。 在這種情況下,您可以應用DATE函數來解決該問題。

= DATE(YEAR(日期)+ 年數,MONTH(日期)+ 月數, 天(日期)+ 天數)

1。 選擇要放置計算結果的空白單元格,鍵入公式 =DATE(YEAR(A2)+3,MONTH(A2)+5,DAY(A2)+15),然後按 Enter 鍵。 看截圖:
備註:要減去年,月和日的組合,請使用以下公式 =DATE(YEAR(A2)-3,MONTH(A2)-5,DAY(A2)-15).

2。 如果需要,請拖動此公式單元格的“自動填充”手柄以將此公式應用於其他單元格。

用Kutools for Excel添加或減去日期,週,月或年至今

如果您安裝了Kutools for Excel,則將找到它 公式助手 列出最常用的公式,以幫助您輕鬆地在Excel中進行計算,包括添加迄今為止的天,週,月或年。 請執行以下操作:

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

1。 選擇要放入計算結果的單元格,然後單擊 庫工具 > 公式助手 > 加上年份.
尖端:請從中選擇合適的公式 公式助手 根據您的需求下拉列表。 例如,選擇 加上星期數 用於在日期中添加/減去指定的星期數。

2。 在打開的“公式幫助器”對話框中,在 約會時間 框,然後鍵入您將在 聯繫電話 框。
尖端:在我們的例子中,我們將從日期起添加5年,因此我們輸入 5聯繫電話 框。 如果您需要減去某些年份(例如3年),請在 聯繫電話 框。

3。 點擊 Ok 按鈕以應用公式 加上年份。 如有必要,請拖動“填充手柄”以將此公式應用於其他範圍。

加上/減去日期:

到目前為止添加/減去週:

加上/減去到目前為止的月份:

Kutools for Excel的 公式助手 可以避免Excel用戶記憶複雜的公式,並列出最常用的公式,以幫助您快速計算和解決Excel中的問題。 加上年/月/週/日, 加上小時/分鐘/秒等等。 免費試用!

演示:在Excel中添加或減去日期,週,月或年


300種工具可幫助您脫穎而出

用Kutools for Excel- 永遠不用擔心裁員

Kutools for Excel 提供了 300 個為 1500 個工作場景量身定制的便利工具,讓您的速度和效率超越同事,贏得老闆的信任。即使在困難時期也能確保自己的地位並確保家庭的穩定。

  • 只需3分鐘即可成為Excel專家並獲得廣泛讚賞。
  • 提升工作效率80%,解決80%的Excel問題,避免加班。
  • 加速您的任務,每天節省 2 小時用於自我提升和家庭時光。
  • 簡化您的 Excel 任務,減少記住複雜公式和 VBA 程式碼的需要。
  • 減少與重複性任務相關的壓力和疲勞。
  • 只投資 $49.0,在培訓中獲得價值超過 4000.0 美元的收益。
  • 被 110,000 多名頂尖員工和 300 多家知名公司選擇,在 Excel 方面表現出色。
  • 提供 30 天的全功能免費試用,無需信用卡。
讀更多...
立即免費試用
 
Comments (67)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How to add or subtract 5Y 8M 23D and 2Y 3M 12D in excel with formula
This comment was minimized by the moderator on the site
How to add or subtract 5Y 8M 23D and 2Y 3M 12D in excel with formula
This comment was minimized by the moderator on the site
1- 2year,4months,29days
and

2- 0year,9months,1days
how to calculate formula in Excel both 1 & 2 in same format like (3years 1 months 30days)
This comment was minimized by the moderator on the site
Hello, Nigam,
To solve your problem, the following User Defined Function may hep you:
Function CalculateDate(pRg As Range, pRg2 As Range)
    On Error GoTo Err
    Application.Volatile

    Dim xRegEx As Object
    Set xRegEx = CreateObject("VBSCRIPT.REGEXP")
    y1 = 0
    y2 = 0
    y = 0
    m1 = 0
    m2 = 0
    m = 0
    d1 = 0
    d2 = 0
    d = 0
    res = ""
    With xRegEx
        .Pattern = "\d+ ?year"
        .Global = True
        .IgnoreCase = True
    End With
    y1 = CInt(Replace(xRegEx.Execute(pRg.Value).Item(0), "year", ""))
    y2 = CInt(Replace(xRegEx.Execute(pRg2.Value).Item(0), "year", ""))
    xRegEx.Pattern = "\d+ ?months"
    m1 = CInt(Replace(xRegEx.Execute(pRg.Value).Item(0), "months", ""))
    m2 = CInt(Replace(xRegEx.Execute(pRg2.Value).Item(0), "months", ""))
    xRegEx.Pattern = "\d+ ?days"
    d1 = CInt(Replace(xRegEx.Execute(pRg.Value).Item(0), "days", ""))
    d2 = CInt(Replace(xRegEx.Execute(pRg2.Value).Item(0), "days", ""))
    d = d1 + d2
    If d > 31 Then
        d = d - 31
        m = 1
    End If
    m = m + m1 + m2
    If m > 12 Then
        m = m - 12
        y = 1
    End If
    y = y + y1 + y2
    res = y & "year," & m & "months," & d & "days"
Err:
    CalculateDate = res
End Function


After pasting this code, please apply this formula: =CalculateDate(A2,B2)

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
terima kasih, saya jadi mengetahui rumus menambahkan 1 bulan
This comment was minimized by the moderator on the site
Έχω σε κελιά το χρόνο υπηρεσίας υπαλλήλων
με τη μορφή "15χρ 00µη 17ηµ" (όλο σε ένα κελί).
Ξέρετε αν μπορώ να κάνω πράξεις με αυτό ???

π.χ. να Προσθέσω xxμη yyημ και να έχω 15χρ 00+xxµη 17+yyηµ
This comment was minimized by the moderator on the site
Hello, Ξερόλας!
Sorry, I can't understand your problem clearly, you can describe your problem in English.
Thank you!
This comment was minimized by the moderator on the site
Έχω σε κελιά το χρόνο υπηρεσίας υπαλλήλων
με τη μορφή "15χρ 00µη 17ηµ" (όλο σε ένα κελί).
Ξέρετε αν μπορώ να κάνω πράξεις με αυτό ???

π.χ. να Προσθέσω xxμη yyημ και να έχω 15χρ 00+xxµη 17+yyηµ
This comment was minimized by the moderator on the site
lo que requiero es sumar a una fecha solo los dias "4 martes" y "4 jueves"
This comment was minimized by the moderator on the site
hi, i need to substract dates formula of machine break down hoursi.e : machine breakdown started 1/1/2021  next cell 6:00 am job done 15/1/2021 4:00 PM 
with minimum 10 hours each day = 150 hours(15 days)
can some one help me out on this formula..
This comment was minimized by the moderator on the site
How to add or subtract 5Y 8M 23D and 2Y 3M 12D in excel with formula
This comment was minimized by the moderator on the site
i need your help, i want to solve one question please tell me
one boy is going on leave from 26-06-2018 to 22-07-2018 for 27 days and his total monthly salary is 23968

if the month has 30 days then his salary will be per day 798.93 & if month has 31 days then 773.16

he was on leave in july 05 days(30 days in the month) and rest 22 dyas in july(31 days in the month)
23968/30*5+23968/31*44
i want then formula for this calculation in one cell please tell me as soon as possible because its urgent for me mail me on my personal mail
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