How to add and subtract dates, days, weeks, months and years in Excel

In this tutorial, you will find a variety of useful formulas to add and subtract dates in Excel, such as subtracting two dates, adding days, weeks, months and years to a date, and more.

If you have been following our tutorials to working with dates in Excel, you already know an array of formulas to calculate different time units such as days, weeks, months and years.

When analyzing the date information in your worksheets, you are likely to perform some arithmetic operations with those dates too. This tutorial explains a few formulas for adding and subtracting dates in Excel that you may find useful.

How to subtract dates in Excel

Supposing you have two dates in cells A2 and B2, and now you want to subtract one date from the other to know how many days are between these dates. As is often the case in Excel, the same result can be achieved in several ways.

Example 1. Subtract one date from the other directly

As you probably know, Microsoft Excel stores each date as a unique serial numbers beginning with 1 that represents January 1, 1900. So, you are actually subtracting two numbers, and an ordinary arithmetic operation works without a hitch:


Example 2. Subtract dates using Excel DATEDIF function

If the above formula looks too plain, you can achieve the same result in a guru-like way by using Excel's DATEDIF function:

=DATEDIF(A2, B2, "d")

The following screenshot demonstrates that both calculations return identical results, except for row 4 where the DATEDIF function returns the #NUM error. Let's figure out why that happens.

When you subtract a more recent date (6-May-2015) from an earlier date (1-May-2015), the subtraction operation returns a negative number (-5) exactly as it should. The syntax of the Excel DATEDIF function, however, does not allow the start date to be greater than the end date and therefore it returns an error.
Subtracting two dates in Excel

Example 3. Subtract a date from the current date

To subtract a date from today's date, you can employ either of the above formulas. Just use the TODAY() function instead of date 1:




Like in the previous example, both formulas work fine when today's date is greater than the date you are subtracting from it, otherwise DATEDIF fails:
Subtracting a date from the current date in Excel

Example 4. Subtracting dates with Excel DATE function

If you prefer to supply the dates directly in the formula, then enter each date using the DATE(year, month, day) function and then subtract one date from the other.

For instance, the following formula subtracts 15-May-2015 from 20-May-2015 and returns the difference of 5 days:

=DATE(2015, 5, 20) - DATE(2015, 5, 15)
Subtracting dates using the Excel DATE function

Wrapping up, when it comes to subtracting dates in Excel and you want to find out how many days are between two dates, it makes sense to go with the easiest and most obvious option - simply subtract one date directly from another.

If you are looking to count the number of months or years between two dates, then the DATEDIF function is the only possible solution and you will find a few formula examples in the next article that will cover this function in full details.

Now that you know how to subtract two dates, let's see how you can add or subtract days, months, or years to a given date. There are a number of Excel functions suitable for this purpose, and which one you use depends on which unit you want to add or subtract.

How to subtract or add days to date in Excel

If you have a date in some cell or a list of dates in a column, you can add or subtract a certain number of days to those dates using a corresponding arithmetic operation.

Example 1. Adding days to a date in Excel

The general formula to add a specified number of days to a date in as follows:

Date + N days

The date can be entered in several ways:

  • As a cell reference, e.g. =A2 + 10
  • Using the DATE(year, month, day) function, e.g. =DATE(2015, 5, 6) + 10
  • As a result of another function. For example, to add a given number of days to the current date, use the TODAY() function: =TODAY()+10

The following screenshot demonstrates the above formulas in action. The current date at the moment of writing was 6 May, 2015:
Adding days to a date in Excel

Note. The result of the above formulas is a serial number representing the date. To get it displayed as a date, select the cell(s) and press Ctrl+1 to open the Format Cells dialog. On the Number tab, select Date in the Category list, and then choose the date format you want. For the detailed steps, please see How to change date format in Excel.

Example 2. Subtracting days from a date in Excel

To subtract a given number of days from a certain date, you perform a usual arithmetic operation again. The only difference from the previous example is that you type the minus sign instead of plus :)

Date - N days

Here are a few formula examples:

  • =A2-10
  • =DATE(2015, 5, 6)-10
  • =TODAY()-10

Subtracting days from a date in Excel

How to add or subtract weeks to date

In case you want to add or subtract whole weeks to a certain date, you can use the same formulas as for adding / subtracting days, and simply multiply the number of weeks by 7:

Adding weeks to a date in Excel:

cell+ N weeks * 7

For example, you add 3 weeks to the date in A2, use the following formula: =A2+3*7.

Subtracting weeks from date in Excel:

cell - N weeks * 7

To subtract 2 weeks from today's date, you write =TODAY()-2*7.

How to add / subtract months to date in Excel

If you want to add or subtract a certain number of whole months to a date, you can employ either the DATE or EDATE function, as demonstrated below.

Example 1. Add months to a date with Excel DATE function

Taking a list of dates in column A for example, type the number of dates you want to add (positive number) or subtract (negative number) in some cell, say C2.

Enter the following formula in cell B2 and then drag the corner of the cell all the way down to copy the formula to other cells:

=DATE(YEAR(A2), MONTH(A2) + $C$2, DAY(A2))
Adding months to a date with Excel DATE function

Now, let's see what the function is actually doing. The logic behind the formula is obvious and straightforward. The DATE(year, month, day) function takes the following arguments:

  • the year of the date in cell A2;
  • the month of the date in A2 + the number of months you specified in cell C2, and
  • the day of the date in A2.

Yep, it's that simple :) If you type a negative number in C2, the formula will subtract months instead of adding them:

Adding / subtracting months to a date with Excel DATE function

Naturally, nothing prevents you from typing the minus sign directly in the formula to subtract months from a date:

=DATE(YEAR(A2), MONTH(A2) - $C$2, DAY(A2))

And of course, you can type the number of month to add or subtract in the formula instead of referring to a cell:

=DATE(YEAR(date), MONTH(date) + N months, DAY(date))

The real formulas could look similar to these:

  • Add months to date: =DATE(YEAR(A2), MONTH(A2) + 2, DAY(A2))
  • Subtract months from date: =DATE(YEAR(A2), MONTH(A2) - 2, DAY(A2))

Example 2. Add or subtract months to a date with Excel EDATE

Microsoft Excel provides a special function that returns a date that is a specified number of months before or after the start date - the EDATE function. It is available in modern versions of Excel 2007, 2010, 2013 and upcoming Excel 2016.

In your EDATE(start_date, months) formulas, you supply the following 2 arguments:

  • Start_date - the start date from which to count the number of months.
  • Months - the number of months to add (a positive value) or subtract (a negative value).

The following formula used on our column of dates yields exactly the same results as the DATE function in the previous example:

Adding or subtracting months to a date with Excel EDATE formulas

When using the EDATE function, you can also specify the start date and the number of month to add / subtract directly in the formula. Dates should be entered by using the DATE function or as results of other formulas. For example:

  • To add months in Excel:

    =EDATE(DATE(2015,5,7), 10)

    The formula adds 10 months to 7-May-2015.

  • To subtract months in Excel:

    =EDATE(TODAY(), -10)

    The formula subtracts 10 months from today's date.

Note. The Excel EDATE function returns a serial number representing the date. To force Excel to display it as a date, you should apply the Date format to the cells with your EDATE formulas. Please see Changing the date format in Excel for the detailed steps.

How to subtract or add years to date in Excel

Adding years to a date in Excel is done similarly to adding months. You use the DATE(year, month, day) function again, but this time you specify how many years you want to add:

DATE(YEAR(date) + N years, MONTH(date), DAY(date))

In your Excel worksheet, the formulas may look as follows:

  • To add years to a date in Excel:

    =DATE(YEAR(A2) + 5, MONTH(A2), DAY(A2))

    The formula adds 5 years to the date in cell A2.

  • To subtract years from a date in Excel:

    =DATE(YEAR(A2) - 5, MONTH(A2), DAY(A2))

    The formula subtracts 5 years from the date in cell A2.

If you type the number of year to add (positive number) or subtract (negative number) in some cell and then refer to that cell in the DATE function, you will get a universal formula:

Subtract or add years to a date in Excel

Add / subtract days, months and years to date

If you carefully observed the two previous examples, I think you have already guessed how to add or subtract a combination of years, months and days to a date in a single formula. Yep, using the good old DATE function :)

To add years, months, days:

DATE(YEAR(date) + X years, MONTH(date) + Y months, DAY(date) + Z days)

To subtract years, months, days:

DATE(YEAR(date) - X years, MONTH(date) - Y months, DAY(date) - Z days)

For example, the following formula adds 2 years, 3 months and subtracts 15 days from a date in cell A2:

=DATE(YEAR(A2) + 2, MONTH(A2) + 3, DAY(A2) - 15)

Applied to our column of dates, the formula takes the following shape:

=DATE(YEAR(A2) + $C$2, MONTH(A2) + $D$2, DAY(A2) + $E$2)

Add / subtract days, months and years to date

How to add and subtract times in Excel

In Microsoft Excel, you can add or subtract times using the TIME function. It lets you operate on time unites (hours, minutes and seconds) exactly in the same way as you handle years, months and days with the DATE function.

To add time in Excel:

cell + TIME(hours, minutes, seconds)

To subtract time in Excel:

cell - TIME(hours, minutes, seconds)

Where A2 contains the time value you want to change.

For example, to add 2 hours, 30 minutes and 15 seconds to the time in cell A2, you can use the following formula:

=A2 + TIME(2, 30, 15)

If you want to add and subtract time unites within one formula, just add the minus sign to the corresponding values:

=A2 + TIME(2, 30, -15)

The above formula adds 2 hours and 30 minutes to the time in cell A2 and subtracts 15 seconds.

Alternatively, you can enter the time unites you want to changes in some cells, and refer to those cells in your formula:

=A2 + TIME($C$2, $D$2, $E$2)

Adding and subtracting times in Excel

If the original cells contain both date and time, the above formula works perfectly too:
Adding and subtracting times to a date and time

Date & Time Formula Wizard - quick way to add and subtract dates in Excel

Now that you know a bunch of different formulas to calculate dates in Excel, wouldn't you want to have just one that can do all this? Of course, such a formula can never exist. However, there exists the Date & Time Wizard that can build any formula for you on the fly, provided that you have our Ultimate Suite installed in your Excel. Here's how:

  1. Select the cell in which you want to insert the formula.
  2. Head to the Ablebits Tools tab, and click the Date & Time Wizard button:
    Date & Time Formula Wizard for Excel
  3. The Date & Time Wizard dialog window shows up. Depending on whether you want to add or subtract dates, switch to the corresponding tab, supply data for the formula arguments, and click the Insert Formula button.

As an example, let's add a few months to the date in cell A2. For this, you go to the Add tab, type A2 in the Enter a date box (or click in the box and select the cell on the sheet), and type the number of months to add in the Month box.

The wizard makes a formula and shows its preview in the cell. It also shows the calculated date under Formula result:
Building an Excel formula to add months to date

If you are satisfied with the result, click the Insert formula button. Once the formula is added, you can copy it to as many cells as necessary:
The formula to add months to date

That was quite a simple formula, wasn't it? Let's give the wizard something more challenging to work on. For example, let us subtract some years, months, weeks and days from the date in A2. To have it done, switch to the Subtract tab and type the numbers in the corresponding boxes. Or you can enter the units in separate cells and supply references to those cells, as shown in the screenshot below:
Making a formula to subtract years, months, weeks and days from date

Clicking the Insert formula button inputs the following formula in A2:


If you plan to copy the formula to other cells, you have to change all cell references except A2 to absolute references so that the formula copies correctly (by default, the wizard always uses relative references). To fix the reference, you simply type the $ sign before the row and column coordinates, like this:


And get the following results:
The formula to subtract years, months, weeks and days from date

Additionally, you can click the Show time fields link and add or subtract date and time units with one formula.

If you wish to play with the Date & Time Formula Wizard in your own worksheets, you are welcome to download the 14-day trial version of the Ultimate Suite.

This is how you add and subtract dates in Excel. I am hopeful you have learned a couple of useful functions today. I thank you for reading and hope to see you on our blog next week.

You may also be interested in

251 comments to "How to add and subtract dates, days, weeks, months and years in Excel"

  1. Deepender Singh Shekhawat says:

    I have calculated difference between two dates using datedif formula
    but Iam having problem calculating difference from the result that i got from above formula like eg. (dd/mm/yyyy)

    Start date = 20/04/1983 End date = 31/03/2017
    the result i got is 33year, 11months, 11days. Now I want to substract 49 days from the result which Iam not able to do it. Please help me solve the calculation.

  2. Fiaz says:

    I want to generate weekly report on sunday or on Monday, but data will be taken upto every Saturday, how can I use formula to calculate the values based on selected dates, e.g I have data from 1-aug-17 to 21-Oct-17, I want to calculate the values between these dates, but in next week how I can calculate it, as the date will be changed to 28-Oct-17 and so on....

  3. Tooley says:

    Very helpful. I used the subtract dates instructions for the simple task of calculating a series of due dates based on an upcoming meeting date. I didn't realize it was so simple, but I would not have thought of trying it without your instructions. Thanks!

  4. Benjhurt says:

    I'm having trouble listing dates via function.
    what i'm trying to get is:
    A1= Current Date in YY Mmm format {=TEXT(TODAY(),"YY Mmm")} lets say it reads: "17 Oct"
    A2= One month later: "17 Nov"
    A3= One Month after that: "17 Dec"
    and here is where things get to be an issue A4= One more month: "18 Jan"
    Which is how it should read, but the next one, A5, reads "17 Feb" when it should read "18 Feb"
    and then it should continue from there, updating the year as each January passes. And every time the current month changes, the months along the entire A column would reflect that.

  5. Rick Blair says:

    I am looking to show only the last 4 weeks of play for each player with a rolling total. I have tried a number of formulas and I am still having problems: (SUMIF and how to subtract weeks).
    The Total of 149 is for 5 weeks. 20 June 17 and 21 should be hiding or disappear and be replace by 27 June 17and 33 and so on. The total should read 128.

    W1 W2 W3 W4 W5 Tot

    20-Jun-17 27-Jun-17 04-Jul-17 11-Jul-17 18-Jul-17

    21 33 33 30 32 149

    Thanks for your guidance. Using Excel 2007.

  6. sham says:

    Hi ,

    The tab is called Open Issue -It has a reported date column ,
    I have a status column and
    What I need is the status column should display 'Less than 30day open' , 'between 30 to 60days' 'open and more than 90 days'.

    I was able to get =TODAY()-A5 = to get the number days open but not sure how to move forward from there

  7. Preetam Singh says:


    I enter multiple dates in Single Column and Deduct from Today's Date

    Rcpt Date

    Today's Date

    Now I want to Deduct today()-27.07.17

    Is it Possible

  8. Derrick says:

    I have a column formatted as date YYYY-MM-DD, and I am using your formula to add 50 to the year.
    I used
    I thought this would be simple, but I am getting a Value error. I am obviously missing something simple, but I am having one of those days

    Any help would be appreciated. Thanks

    • Derrick says:

      I discovered the problem, Excel thinks the world started after 1900. My dates were 1800s and Excel does not recognize anything before 1900 as a date.

  9. Mark Crowder says:

    How would I go about adding 90 days to a date. I am looking to add 90 days from one column to another.

  10. Ben Mcg says:

    I'm trying to use dates for my study spreadsheet, and I have the end of semester date - Todays date which gives me my total days left. This is great, except I now want to subtract every thurs and fri (for work) from that! And I want this to constantly self update, so that when I pass those days, that subtraction is no longer reflected in the total. I also then want to subtract a specific two weeks (date to date)also for a trip in between.

    Please help :)

  11. Patrick delli says:

    Trying to estimate approximate production dates from the following data:
    1st Unit, serial 1701, produced on 01/July/1931
    165th Unit, serial 1866, produced on 01/July/1935
    Average .793 unit made per week

    How can I calculate the rough production date in DD/MM/YYYY format for each of the 165 units?

    Formula to be copied/pasted in existing excel sheet.

    Thanks in advance!!!


  12. chloe says:

    how to add dates on excel?. I created a table containing data of daily sales with a date above on it but i can't filter each date since it never appears in filter

  13. Ian says:

    Hi I am trying to calculate the difference between two numbers represented as years and months. ie What is the difference between 7 years and 2 months and 5 years and 10 months?

  14. zooel kabir says:

    How to calculate the how many days left?
    If my campaign start Date 4/29/2017 and ends at 11/14/2017.

    How can i calculate that how many days left to ends this campaign?

    where Strat Date on cell B2 and Ends Date At cell D2 i have to calculate E2

  15. NELSON says:

    I NEED TO SHOW CORRECT MONTHS TO DETERMINE TAX EG. START DATE 1/APR/17 END DATE IS 31/MAR/18, IF I HAVE A DATE 4/June/18 or 5/Nov/18 how can i have to arrive at 12 months from start date. what formula I have to use to get correct months.

  16. Shahid Zaheer says:

    i have calculated the experience of employees like form 1/1/1998 to 25/9/2000
    answer is 2 years, 0 months, 24 days and second form 1/11/2000 to 31-12-2002 answer is 2 years, 0 months, 30 days and third form 5/4/2003 to 08-01-2007 answer is 3 years, 0 months, 04 days now i want to calculate the three answers in a manner to 07 years, 01 month, 28 days.

    How could i am able to calculate it with the help of formula


    Best Regards

    Shahid Zaheer Meo

  17. James Duffy says:

    Thank you for a very interesting article and website.

    If I put 3/31/2017 in A1, the formula =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))in B1, and the formula =EDATE(A1,1)in C1, I get 5/1/2017 for B1 and 4/30/2017 for C1.

    I was expecting the same result for each formula.

    Why is there a difference when both formulas are supposed to yield the same, namely one month from 3/31/2017?

    What am I missing?

    • Hi, James,
      it is a very interesting notice! DATE and EDATE functions treat the months in slightly different ways. EDATE adjusts the results by adding a whole month (but since April consists of 30 days, its last day is shown). DATE, in its turn, adds the same number of days, but the 31st day is treated by the function as the 1st day of the next month. Please, look at the example below to get a clear understanding.

      DATE and EDATE functions results

  18. Ron Mateo says:

    Hi I need a formula to know the number of days a project is delayed
    No. of day required days = 7 days
    Start date = March 20, 2017
    End date = March 24, 2017

    What formula can I use to reflect no. of days a project is advanced or delayed. Excluding Sat Sun and holidays

    • Hi Ron,

      Let's say that start day is in A1, end date is in B1.
      First of all, you need to count the number of working days between your dates in C1:
      You can find out how to exclude weekends and holidays here.

      Then, depending on how you want the result to return:
      a) if as a text in D1, enter the next formula there:

      b) if you want to fill C with a colour, create formatting rules using formulas:
      =AND($C1<=7,$C1<>"") (green colour for advanced)
      =AND($C1>7,$C1<>"") (red, meaning delayed)
      Apply the formatting for =$C:$C column.

      Hope it helps!

  19. K says:

    I need a formula to calculate a date with a number if that number is greater than 0.

    4/27/2016 | 73 | __________
    7/14/16 | 0 | __________

    I tried using SUMIF but no luck. Is this possible?

  20. JM says:

    Well after googling several add month solutions it appears that the 2 solutions actually do not work as I would expect them.

    How do you actually get the last day of the month based on the last day of the previous month ?

    If I add 1 month for example to the last day of September 2015 i.e:
    A1=date(2015,09,30) := 2015-09-30
    A2=date(year(A1),month(A1)+1,day(A1)) := 2015-10-30
    This is 1 day before the last day of October 2015.
    So it isn't adding 1 month but 1 month minus 1 day.

    I was expecting to get as a result: 2015-10-31

    Same result using EDATE
    A1=date(2015,09,30) := 2015-09-30
    A2=EDATE(A1,1) := 2015-10-30

    The only way I found to get this to work i.e: get the date of the last day of the month based on previous last day of the month is:

    A1=date(2015,09,30) := 2015-09-30
    A2=DATE(YEAR(A1+1),MONTH(A1+1)+1,DAY(A1+1))-1 := 2015-10-31

    • Tim R says:

      The EOMONTH formula will return the last day of the month, and you can specify how many months before or after your original date. e.g. if your original date is in cell A1, =EOMONTH(A1,3) will return the last day of the month three months later. I hope that helps.

  21. Lauren Bullock says:


    I have a list of dates (column I) which show when training was completed. In column J I have my formula for adding 1 year to the date in column I for when the training is to be renewed. In some of column I i don't yet have a date, in column J this comes up as 31-Dec-00 as there is no data inputted in column I. Can i add something to my formula to say if the cell in column I is empty then for the cell in column J to stay blank?

    The formula i'm using in column J is: =DATE(YEAR(I2)+1,MONTH(I2),DAY(I2))


  22. Andi says:


    I'm using the following formula: =DATEDIF(C6,D6,"d") to calculate the difference between days. Works well. However, when the date is the same in both cells, is there a way for me to add "1" to show a calculated answer of 1 in the final field? (Trying to account for number of days traveled in a month and, although it's the same day, it should still count as 1 day.)



  23. Manjunath says:

    How do I get the below in excel,
    suppose I have a date in A1 as 01/25/2017 13:00 and in B1 I have time to be added as 56:15 (56 hours and 15 mins), i have to add these hours and mins to A1 and get the result as 01/27/2016 21:15

  24. Yoscha says:

    Dear all,

    Hope you can help me with a formula in Excel 2010.

    If K:K is the letter "S" it must add 7 days to the date entered in I:I

    For Example
    S = 21-Jan-17 + 7 days > Entered in L:L as 28-Jan-17

    Please help me. :(

  25. Yoscha says:

    Dear all,

    Hope you can help me with a formula in Excel 2010.

    If K:K is the letter "S" it must add 7 days to the date entered in I:I

    For Example
    S = 21-Jan-17 + 7 days > Entered in L:L as 18-Jan-17

    Please help me. :(

  26. Riya KS says:


    I need to add the number delivery days to an part that to find wne it will be return to us.
    For expample: A part was sent to supplier in January, return time from supplier is 6 month to return ie 180 days. This means I will have the part in warehouse in July.

    Can I have a formula for this... i have 1000+ part with different return date.


  27. Rena says:

    That is not what I'm asking. I have a spreadsheet with hire date, 3 month eval, 6 month eval, and 9 month eval. I want to take today's date and subtract it from the due date. If it is more than 5 days, I want the cell to turn red. If it is 5 days or less, I want the cell to turn yellow. Anything over 5 days will not change.

  28. azmathulla shaik says:

    In gregorian date if we mention date as 1/13/15 then it can show as 13.01.2015 and while applying Filter it will show us years 2015 2014 2013, by selecting the year we will have months then dates... same way I wish to have for Hijri (Arabic) dates as by typing 2/20/38 it shall show as 20.02.1438 and by applying Filter it should show 1438 1437 1436, then by selecting year it should show months then dates.... Please advise

  29. Rena says:

    I want to take hire date and do evaluation at 3 months, 6 months and 9 months. I entered the hire date in b2 and want the values in c2, e2, and g2. I used the formula of 10/5/2016 as date in b2 with =sum($b2)+90)) to get the 30 day,=sum($b2)+180))for 6 months, =sum($b2)+270))for 9 months.

    Now in column d2, f2 and h2, I want it to highlight the cell red if date in c2 is more than days overdue and yellow if date is between 1 and 5 days until due. If evaluation is done or if evaluation is more than week from due, cell remains white background.

    How do I get it to subtract the due date from today's date and set the cell to change colors?

  30. Jay says:

    Hi, how do I subtract 3 months from an end date given and the result must be the month end date instead beginning of the month?

    For example:
    3 months prior to due date Due date
    31/10/2017(I must get this result) 31-Jan-18
    01/10/2017(this result must be 30/09/17) 31-Dec-17
    30/08/2017(this result must be 31/08/17) 30-Nov-17
    (Formula =DATE(YEAR(M36), MONTH(M36) - 3, DAY(M36))

  31. James says:

    Hello, I need help with a simple understanding manual formula because i can not use excel to get the answer to the following: 3 years 5 months 40 days + 4 years 8 months 15 days - 10 years 15 months 40 days

    How would i get the answer using paper?

    Thanks for your help and would greatly appreciative!

  32. fernando says:

    Is there a way to have a date in A1 through E1 but then in F1 through H1 have the date be a week later? Basically I want a pattern of every 5 columns to have a date and the following 4 column have a week later and continue that 5,4 pattern?

  33. sam says:

    I need urgent help ..

    i need to add (N) number of days to costume date ( DD/MM/YYYY) with excluding Friday and calculate Thursday as half day .

    Meaning :
    operation take 23 days
    today date : 1/1/2017
    Friday is off and Thursday half day working ..

    i want to know the date when operation end .

    any help

  34. Melissa I says:


    I am trying to calculate a result in where I can determine an expiration date of a specific date within 1 month.

    Example- Start Date is 2/17/2016 and End date is 02/16/2017. I would like to create a formula that will be able to tell me when the end date expires
    1 month before.

    Is that possible and how can I use the Edate and Today formula to get that calculation?

    Thank you in advance for your help!

    Melissa I

  35. Colin says:

    Hi i am trying to work out days elapsed on a task

    Start Date - Completed date (this is easy) but if the item is not closed and no date is entered i want Todays date to be default

    Please help

  36. SteveJWR says:

    I can not for the life of me figure out how to do this!
    I want to track how long staff spend on task.
    They put the date & time started and the date & time they finish.
    I need to get the total hours & minuted (hh:mm)working.
    Deduct :30 for break and 1:00 for lunch. Then if the start and finish is greater than a day, subtract the 15 hours (overnight)

    H1[START] = 24/11/2016 09:45
    I1[FINISH] = 25/11/2016 08:35
    J1=[TIMEWORKED] ??? (hh:mm)

    Work day is from 06:00 - 15:00
    Break from 09:00 - 09:30
    Lunch from 11:00 - 12:00

    I need to do this macro free. I have been trying to sold this for ages. Looked all over the internet. What I have established is that I need to show the times as general formatting do the calculations and then display the result as hh:mm. My head aches trying to resolve the calculations though.

    Any help, ideas, advice??

  37. Dave Delcourt says:

    Hi all,

    Following this thread and trying to create a list in Column A to reflect a weekly schedule with the value in A3 being the baseline and incrementing A4, A5, etc... by 7 days, simple stuff based on this site... so I thought... ;)

    Desired results
    Cell A3 - 1/10/2017
    Cell A4 - 1/17/2017
    Cell A5 - 1/24/2017

    Current configuration
    Cell A3
    - Format: Date (3-14-2012 from Date format Type list)
    - Current value: 1/10/2017

    Cell K1
    - Format: Number
    - Current value: 7

    Cell A4
    - Format: Date (3-14-2012 from Date format Type list)
    - Formula: =DATE(YEAR(A3),MONTH(A3),DAY(A3)+$K$1)
    - Resultant value: #VALUE!

    I'm on Office2016 64-bit on a WINDOWS7 64-bit, i7 CPU/16GB RAM

    If I go to Cell A3 and "drag down" to A4 the date increments to 1/10/2018 so it seems as though it is recognized as a date...

    Looking at the Function bar dialog box when you click on "fx" it shows:


    Year: YEAR(A3) = #VALUE!
    Month: MONTH(A3) = #VALUE!
    Day: DAY(A3)+$K$1 = #VALUE!

    Formula result =


    I then look at "Evaluate formula" and get (CY2017 is the tab name):


    Reference Evaluation
    'CY2017'!$A$4 = DATE(YEAR("1-10-2017"),MONTH(A3),DAY(A3)+$K$1)

    The next evaluation will result in an error.


    No change if I modify Date "type" format or change "/" to "-"...

    Why would the date not format to 1-10-2016 per the selected Date format?
    - I went to a blank cell and modified the cell format to the same as above, when I then enter 1/10/17 it changes to 2001-10-17... huh??

    Appreciate any insight, thanks.


    • Dave Delcourt says:

      OK, all I can say is WOW... :) I got this to work but it seems to me to have been MUCH more complicated than need be...

      Additional/changed config (from previous post)
      Cell J1
      - Format: Date (*2012-03-14)
      - Current value: 2017-01-10

      Cell A3
      - Format: Date (3-14-2012)
      - Formula: =DATE(YEAR(J1),MONTH(J1),DAY(J1)+0)
      - Resultant value: 1-10-2017

      Cell A4
      - Format: Date (3-14-2012)
      - Formula: =DATE(YEAR(A3),MONTH(A3,DAY(A3)+$K$1)
      - Resultant value: 1-17-2017

      I then drag A4 down to fill out the rest of the year and it works.

      Really feels like this was way more complicated than need be, thoughts?


  38. Naveed Khalil says:

    Hope you doing well in the best of health. I really like the page, which is much helpfull. I need help please guide me.
    I am doing job at college and we deal majority student matters.
    if a student deposit his/her fee after due date, and due date is e.g 25-09-2016 and deposit date is 27-10-2016. each day after due date will b charge as fine Rs. 100. how i will do it with formula........please help

    • Hi Naveed,

      Assuming the due date is in A2, and the actual payment date in B2, and the fine is 100 per day, you can calculate the fine amount with this formula:

      =IF(B2>A2, (B2-A2)*100, 0)

      If necessary, you can add the fine to the original amount, which is, say, in cell C2:

      =IF(B2>A2, (B2-A2)*100+C2, C2)

  39. Manish Gupta says:

    I have a date derived (via formula) in a cell say A2 and I want to have a new date in cell B2 by adding 2 to Cell A2.

    best part.. In one excel sheet I am able to derive it, but on another sheet I am not :(

    Not sure whats the issue. Please help.


  40. Kristine says:

    how to do formula to deduct

    A.) (7 yrs, 7 months) - (6 yrs, 5 months) = Answer (formula??)
    B.) (8 yrs, 2 months) - (9 yrs, 1 months) = Answer (formula??)

    formula for

    A.) the difference between three nos.

    compare 1st assessment to 2nd assessment
    compare 2nd assessment to 3rd assessment


    1st assessment result is 20
    2nd assessment result is 18
    3rd assessment result is 25

    many thanks in advance for your help!!!

  41. subramanian says:

    i m using a formula in excel =IF(DATEDIF(E7,H7,"D")>0,DATEDIF(E7,H7,"D"),"expired")

    in this i want to add +1 to day in DATEDIF(E7,H7,"D") (i.e) i want the day next to the calculated date . it is possible? if so how , thanks in advance

  42. Robert says:

    I'm attempting to create a conditional format that will cause a cell that has a future date in it, to be flagged yellow when that date is 90 days away.

  43. Ravi says:


    I am trying to subtract date/time but not getting accurate result. Please help me with it.

    7/15/2016 10:30
    7/16/2016 14:00

    How to find the result from above given date/time?


  44. CAYETANO A. GELI says:

    Supposing I have a ranges of cells comprising of due dates that fall on weekends, holidays and weekdays. Whenever a due dates fall on holidays or weekends, transactions would commence on the next following working day. I used IF, OR, WORKDAY, and WEEKDAY functions but i found it very difficult to suppress due date that falls on weekdays (not a holiday) from incrementing by one(1)day. I am formulating a formula that would address all of the records at the same time. Hoping for your assistance.

  45. Lorien says:

    Hi there...Hope you can help me with the following.

    I want to add a date to a cell. Then in a different cell i want it to work out 6 months from the date in the first cell. IF the date then goes pass our current date, i want it to show red or say expired.

  46. queenier says:

    hi please help me, i used =IF(AG2<(TODAY()+2),"DELIVERY DATE",IF(AG2<(TODAY()-1),"DONE","ON GOING")) formula but the result "done" doesn,t work.

    if AG3 is 2 days before delivery date the result is "delivery date" if after delivery date the result is "done" when AG3 has no date the result is "no supplier delivery date" otherwise "on going"

  47. Sandy says:

    I am trying to subtract two dates to get a calculated time between the dates in MM:dd:hh:mm format to see how long it takes to resolve an ticket. Example:

    Start Date: 05/01/2016 13:24
    End Date: 05/17/2016 18:04

    Should end up with 00:16:04:40, but it comes out as 01:16:04:40, and I can't for the life of me figure out how to make that month be 00 and be more accurate.

    I have found several articles that use the ability to manipulate the month itself, but doesn't describe how to subtract two dates AND round down on the month to show the accurate time between the two dates. Any help here would save what hair I have left. Thanks.

    • Hi Sandy,

      You can use DATEDIF to get the number of complete months between 2 dates, and then concatenate the results of several functions in 1 formula:

      =DATEDIF(A1,A2,"m") & ":" & DATEDIF(A1,A2,"d") & ":" & TEXT(TIME(HOUR(A2), MINUTE(A2), SECOND(A2)) - TIME(HOUR(A1), MINUTE(A1), SECOND(A1)), "hh:mm")

      Where A1 is the start date, and A2 is the end date.

      The drawback of this approach is that the result is a text string and you won't be able to use it in other calculations.

      • Sandy says:

        Yes that's the problem. I do need to be able to add the results of this together to get a total time spent on a ticket. Any other ideas?

        • Sorry, I have no other idea. To my best knowledge, none of the Excel functions or formats can display a zero month or day.

          As a workaround, you can use 1 column to present the time difference in an easy-to-understand way (DATEDIF formula). And in another column, calculate the time difference with a simple formula like =A2-A1, and display it in hours and minutes [hh]:mm. And then, use that second column to get the total time.

  48. Lauri says:

    Hi! Is it possible to do math with dates which are formatted 3.4.2016? So separated with dots in other words.

  49. JayaPrakashReddy says:

    I need to calculate no of appointments today basing on date from 1) Data Sheet to dash boadrd

    Prabhakar T Total Number of Meetings the day 3-Jul-16 from data sheet containing the date

  50. Lori says:

    I am looking for a similar calculation as SElizabeth. What I need is a gestational age calculated from a specific due date on a specific date. All I can locate is a formula that gives a calculation based on todays date...which of course will change the resulting value each day. I need for the result to be a fixed value.

    The formula I have is: =FLOOR(279-(K2-TODAY()),7)/7&" weeks "&MOD(279-(K2-TODAY()),7)&" days"

    The K2 value is clients due date. When I try to substitute the TODAY value for a cell that contains the date I want this to calculate off of, I get an error.

    I don't understand excel at I am stuck!

    Any ideas?


  51. SElizabeth says:

    I'm trying to develop a spreadsheet of pregnant patients, and I need a formula to calculate today's gestational age from due date. The output would be something like "35 2/7", meaning 35 weeks and 2 days gestation. Here's the Google Sheets formula that does not work in Excel:

    =ArrayFormula(if(A1:A,int((280-(A1:A-today()))/7)&ʺ ʺ&mod(280-(A1:A-today()),7)&ʺ/7ʺ,iferror(1/0)))

  52. Tracey says:


    I have added 12 months to a date in column E4, but if there is not a date to add to (E4 is blank) then the date shows 31/12/1900. How do I make the cell blank rather than 31/12/1900? I'm having trouble adding an IFBLANK function to the below formula. Thanks :)


  53. Henk says:

    I want to calculate how many years is remaining or expired for the lifetime of equipment from the actual date.

    In service Life Calc end
    date Time date
    14-Feb-05 15 11/Feb/20
    14-Feb-05 15 11/Feb/20
    10-May-03 10 07/May/13
    22-Jul-12 10 20/Jul/22
    22-Jul-12 10 20/Jul/22
    10-May-03 15 06/May/18

    • Hello Hiren,

      If your original values are dates, you can use the following formulas:

      To extract the day of the week: =TEXT(A2, "dddd")
      To extract the date: =TEXT(A2, "mmmm dd, yyyy")

      If your original values are text strings, then use these ones:

      To extract the day of the week: =LEFT(A2, FIND(",", A2)-1)
      To extract the date: =RIGHT(A2, LEN(A2)-FIND(",", A2)-1)

  54. Dex Luther says:

    Hi, I'm trying to organize a schedule for work.

    My sheet is set up so that the person creating the schedule (usually me) enters the Month in a cell, and the week number in another cell (Week number of the year, but could be of the month if it's simpler).

    Once these two fields are entered, I'd like a group of cells to be updated with the dates.

    For example:

    Week Number: 22
    Month: June

    30 31 1 2 3 4 5

    I haven't found any information on how to accomplish this.

  55. SteveJWR says:

    Hey. I have been trying to calculate the hours spent working on a task, excluding daily breaks of 1:30.
    I also do not want to count non working hours. The day starts at 09:00, a break from 13:00-14:00, finishing at 17:00. Some of the tasks may take three days and even span over a (non working) weekend. Cheers.

    05-Apr-16 9:00, 06-Apr-16 14:00 =??:?? hours worked on task.
    05-Apr-16 9:00, 05-Apr-16 17:00
    06-Apr-16 11:00, 06-Apr-16 13:00
    05-Apr-16 0:00, 05-Apr-16 0:00
    05-Apr-16 0:00, 05-Apr-16 0:00
    05-Apr-16 0:00, 05-Apr-16 0:00

  56. Gordon says:

    I am trying to create a formula that can take a date in cell A1 and add months from A2 and give me a date in A3.
    The problem is I need to be able to change A1 or A2 without changing the formula and I want to copy this to about 600 cells.
    Thanks in advance for your help.

  57. Rajesh says:


    Need help to get formula for calculating overall experience. Ex, my previous experience is 3.6 years. My current experience started from 06-June-2012(this exp is calculated using dated if). How to calculate the exact total years of experience in excel(previous number + current)?

    Thanks to help.

  58. Chris says:

    Need some help please and thanks in advanced.

    if I have a date in a cell 08/10/2016 and in the cell to the left of it I like the this date less a month.
    eg from 08/10/2016 to now read 08/09/2016

    thanks again guy's

  59. Adrian Hobley says:

    I am trying to add up hours worked in a month.
    Cells are custom formatted: [hh]:mm
    I used the formula D5=Text(C5-B5, :hh:mm") to get the hours worked on a particular day.
    Then I use =sum(D5:D35) to get the month total but the result is 00:00.
    How do I get this column to add up
    Many thanks
    It's a very useful site.

  60. Ashley says:

    How do i get a a cell to show a specific day before a specified date.

    I need a cell to show the Thursday before any specified date.

    IE cell C2 needs to show the date for the Thursday before the date in cell D2


    • Somnath says:

      suppose you have date in D2 then you can put the formula in C2

      "d" - only date will come
      "dd"- only date will come
      "ddd"- Mon, Sun. wed
      "dddd" - Monday, Tuesday, saturday

    • Ashley says:

      Thanks Samantha, that's not quite what I mean though.

      Say I have today's date (24/04/2016) in cell D2, I need cell C2 to tell me the date for Thursday last week (21/04/2016) but also if I have say tomorrow or Wednesdays date in D2 I still need it to return the previous Thursday (21/04/2016)

      Hope that makes sense

  61. Selvakumar says:

    i need to add or subtract time using now() function and entered value in time format only
    4/19/2016 9:06 5:05:00 PM 42478.67
    when tried I am getting the above value please help

  62. John says:

    Hi guys,

    Please advise on below

    how to modify the next formula formulation for the following:

    If= required date less than 5 weeks,"check","no check)

  63. Zafar says:

    how can I do in one excel box to show a week like
    Jan 01, 2016 to Jan 07, 2016
    Jan 08, 2016 to Jan 14, 2016
    and so on

    I can do manually but I want to do it in a formula.

  64. Hari Keval says:

    Joining Date last date Previous Experience Total Year Experience Grand Total Experience
    25-May-14 1-Jan-16 5 years 3 months 1 years, 7 months, 7 days
    7-Oct-14 31-Mar-16 4 years 2 months 1 years, 5 months, 24 days
    21-Jan-15 24-Mar-16 3 years 9 months 1 years, 2 months, 3 days

    please help how to add Previous Experience to Total year experience....

    • Sorry, it's hard to think about ways of getting data without seeing your table. If the "Previous Experience" column has a string value, you can try the following:

      To get the number of years and months from Previous Experience you can use formulas like these:
      =LEFT(D3, SEARCH(" ", D3, 1)) - for years

      =MID(D3, SEARCH("years", D3, 1)+5, SEARCH("months", D3, 1) - (SEARCH("years", D3, 1)+ 5)) - for months

      If the "Total Year Experience" column is countable, add the results to the formula for this column.

  65. Taolo says:

    The formula "How to add / subtract months to date in Excel" have a gap with date 29

    If I add 1 month from 29/01/2016 to 29/01/2017, the month of February gone missing.

    I manually solve the question, but needed to go deeply. THANK YOU.

  66. Rod says:

    I want to add X number of days to the date is cell A2, showing the resulting date in cell B2. However, if I use =A2+1 (for example) to add one day to the date in A2, but no date has yet been entered in A2, then the display in B2 is "VALUE". Is there a way to not have that display, leaving B2 blank until a date is entered in A2, whereupon B2 would display the date according to the formula?

  67. Ruthie says:

    I need a formula to identify any help desk ticket created between today at 12:01am and a week ago at 12:01am.

    So, in essence, I need to create a formula that says this:
    (If Ticket_Opened_date is between (today at 12:01am - 7 days) and (today at 12:00am), "New", "Old").

    The trouble is the part about it being at 12:01am and making sure the formula is dynamic so I don't have to recreate it each week. Note: Please trust me when I say I can't do it via the standard date filter options (so don't even bother suggesting that).

    Can someone help?

  68. Bola says:

    Just like the comment 3 above i need to calculate the differences between dates to get a format like 2yrs, 3months, 5days, 7hrs and 25min

    for example difference between 20/10/2014 9:34 and 13/12/2016 get
    2years, 1month, 23days, 16hrs, 14min.

    • Hello, Bola,

      Please try this formula:
      =IF(DATEDIF(A2,B2,"y")=0,"",DATEDIF(A2,B2,"y")&" years ")&IF(DATEDIF(A2,B2,"ym")=0,"",DATEDIF(A2,B2,"ym")&" months ")&IF(DATEDIF(A2,B2,"md")=0,"",DATEDIF(A2,B2,"md")&" days") &" " &TEXT(ABS(A2-B2), "h") & " hrs" &" " &TEXT(ABS(A2-B2), "mm:ss") & " min "

  69. Cody says:

    I'm trying to create an If function that would evaluate a score, then based on that score value predict a future test date based off of the date the first test was taken. Here are two examples:

    1.) TESTED: 1/1/2015 SCORE:>70 NEXT TEST:12 months from first date(1/1/2016) 2.) TESTED: 1/1/2015 SCORE:<70 NEXT TEST:6 months from first date(7/1/2016) Do you have any idea how to format this correctly? Every time I try, I end up with either an error, or the result of my text. Thanks!

  70. Barbara Bass says:

    Is there a way to calculate the number of years between four dates? I want to calculate years of employee service where there was a lapse in employment:
    Start date 8/22/2005, End date 8/13/2008 = x years PLUS Start date 7/1/2009, End date 1/19/2010 = TOTAL YEARS. I tried adding two dated ifs together but it didn't work EG: =DATEDIF(A1,A2,"Y")+(DATEDIF(B1,B2,"Y"). (Answer s/b 3 years) Thx!

  71. Md. Golam Rabbany says:

    How can I subtract in excel for below issue?

    [d/m/y h:m AM/PM-d/m/y h:m AM/PM]and note that fri and sat will be excluded from the calculation

  72. Ramki says:

    Hi Jules,

    I assume that the data relating to dates must be a part of a greater data range. The solution to this is as follows:

    Convert the data range to a Table using the Ctrl-T function. You will observe that all the column headings will have a drop-down filter. Click on the filter of the date column and select Date-filters - you will see a wide range of options. In excel 2013 there are 20 options with two more custom options.
    I am sure that you will be able get the required results you need.

    The specific requirement for this sort of filtering is the data in the date column should be entered in date format as per excel predefined formats.


  73. Ramki says:

    Hi Irfan,

    The simplest format I can assume from what you specify is as follows:

    Step 1 - Cell A1 type in the "From" date.
    Step 2 - Cell B1 type in the "To" date.
    Step 3 - Cell C1 type in the fomula "=B1-A1+1. We add one to include the start date. You will then get the number of days.
    Step 4 - In Cell D1 enter the formula to multiply Cell C1 by 24 to get the hours.
    Step 5 - In Cell E1 multiply Cell D1 by 60 to get the number of minutes.
    Note - If you enter the date function in Cell B1 as "=NOW()" then you will get the live time set in excel. This will assist you in getting the calculation of days and minutes, in decimal point, if you wish to.


  74. Irfan says:


    I have some issue to while calculating "FROM" "TO" example :
    FROM 02/01/2016 11:14:13 AM
    TO 05/01/2016 11:14:13 PM
    How can I separate in above date
    - How many Days
    - How many Hrs.
    - How many minutes


    • Mangal Kumbhar says:

      You can follow below steps-
      1. Formate cells- Select date formate as (MM/DD/YY TIME)(03/14/01 1:30PM) change for both cells.
      2. Type below formula as it is-
      =INT(B3-A3)&"Days,"& HOUR(B3-A3) &"hours,"&MINUTE(B3-A3)&"Minutes and"&SECOND(B3-A3)& D3"Second"

      3.If your date is 1st Feb to 1st May then result as below-
      From To Result
      From To Result
      2/1/16 11:14 AM 5/1/16 11:14 PM 90Days,12hours,0Minutes and0Second

      4.And If your date is 2nd Jan to 5th Jan then result as below-
      From To Result
      1/2/16 11:14 AM 1/5/16 11:14 PM 3Days,12hours,0Minutes and0Second


  75. Jules says:


    I have a long list of records each with a date. I would like to filter my list to only show recent records dated today or within the last 21 days. I cannot find a way to do this despite reading lots of suggestions for date formulas. Please can you help?

    Thanks, Jules

  76. Hanzala says:

    My query Cell
    A1 - 01-jan-2016, i want to make
    B1 - 11-jan-2016,
    C1 - 21-jan-2016
    D1 - 31-Jan-2016,
    E1 - 01-Feb-2016,
    F1 - 11-Feb-2016,
    G1 - 21-Feb-2016,
    H1 - 28-Feb-2016,
    I1 - 01-Mar-2016.........

    A1 - 01-jan-2016, i want to make
    B1 - 11-jan-2016,
    C1 - 21-jan-2016
    D1 - 31-Jan-2016,
    E1 - 11-Feb-2016,
    F1 - 21-Feb-2016,
    G1 - 28-Feb-2016,
    H1 - 10-Mar-2016.......

  77. Mechele says:

    how do I determine the difference between 2 dates, and also show a "0" if the start date is greater than the end date

    • Hi Mechele,

      You can use a simple IF formula, for example:

      =IF(A1>B1, 0, B1-A1)

      Where A1 is the start date and B1 is the end date.

      In a similar manner, you can use the DATEDIF function to calculate the difference between two dates in days, weeks, months or years:

      =IF(A1>B1, 0, DATEDIF())

  78. SALAH says:

    HELLO, I try count between two date (10-12-1990 & 5-1-2016) by use datedif in many computer the result some computer true (25 year 0 month 30 day) and another computer the result false (25 year 0 month 143 day) why the day (143) I cant find the place changed properties in excel to get to same first result.

    .....thank for answer me.

  79. jagadeesh.rt says:


    12/21/2015 8/15/1975

    40-Yrs And 4-Months

    =DATEDIF(E11,D11,"y")&"-Yrs"& " And " & DATEDIF(E11,D11,"ym")&"-Months"

    May be helpful :
    m Months
    d Days
    y Years
    ym Months Excluding Years
    yd Days Excluding Years
    md Days Excluding Years And Months

Post a comment

Thank you for your comment! When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to your query. We cannot guarantee that we will answer every question, but we'll do our best :)