Comments on: Using DATE function in Excel - formula examples to calculate dates

The tutorial explains the syntax and uses of the Excel DATE function and provides formula examples for calculating dates. Continue reading

Comments page 4. Total comments: 372

  1. how to write date formula

    1. date formula ctrl+:
      time gormula ctrl"

  2. or have a formula 031214H August 2016 convert to 08/03/2016... thanks you

    1. Hi BERNARD,

      Try this formula:
      =DATEVALUE(LEFT(A2,2)&"-"&MID(A2,SEARCH(" ",A2)+1,SEARCH(" ",A2,SEARCH(" ",A2)+1)-SEARCH(" ",A2)-1)&"-"&RIGHT(A2,4))

      Where A2 is the cell containing the string 031214H August 2016. Also, be sure to apply the desired date format to the formula cell.

  3. Hi there. Great page but hoping you can answer my query?

    In column A I have a date in format DD/MM/YYYY and want to convert this to be displayed in the MM/DD/YYYY format (or the serial number relating to the date) in column B. I have used Text To Columns to do this but this will not update column B if the value in column A is changed or if a new date is added in the next row down.

    Is there any way I can do this using the DATE, DATEVALUE or any other functions?

    Thanks :)

    1. Hi Mike,

      I can suggest the following 2 ways:

      1. =TEXT(A1, "mm/dd/yyyy") - the result will be a text string, but not a date.

      2. Use this simple formula =A1, and then apply the desired format to the 2nd column (select the column, right click, click Format Cells, select Custom under Category, and type mm/dd/yyyy in the Type box). The resut will be a fully-functional date in the desired format.

  4. I want to change the date format 7/30/2016 in dd-mm-yyy and it should be 30-07-2016. Please help

  5. I have found some valuable info on this great site, but when I try to put what I find into use I keep getting error messages. I'm guessing due to the complexity and my lack of knowledge it's simply not going to work just piecing together the formulae I need from the info I find here.
    I need a formula to work out compliance to a medical standard, the cells are as follows;
    C1 is date of birth
    F1 is date of last medical
    I need to return a yes or no in G1.
    If the subject is over 35 years old the date in F1 has to be less than 5 years ago to return yes. If the subject is under 35 years old F1 has to be within the last 10 years to return a yes value.
    I have been going round in circles with not much luck in creating the right formula.
    Appreciate any help you can provide!

    1. Hi Elyes,

      If my understanding of the task is correct, the following formula should work a treat:

      =IF(OR(AND(DATEDIF(C1, TODAY(), "y")>=35, DATEDIF(F1, TODAY(), "y")<5), AND(DATEDIF(C1, TODAY(), "y")<35, DATEDIF(F1, TODAY(), "y")<10)), "yes", "no")

      1. Works brilliantly! Exactly what I was after. Many thanks.

    2. My only working solution is the formula below, but this does not account for the age of the subject. I can't get the link to the age to work correctly.
      =IF(DATEDIF(F1, TODAY(), "y")<5,"YES","NO")

  6. hi ld like to ask what formula should I use for this. in E2 I have 01/01/2016. I want to create a formula so it will be converted to January in F2. what should I use?

    1. Hi Kit,

      You can do this in 2 ways:

      1. In F2, enter the formula =E2, and then apply the custom date format: mmmm
      You can find the detailed explanation about custom formatting here: How to create a custom date format in Excel.

      2. Use this formula: =TEXT(E2, "mmmm")

      The difference between the above approaches is as follows:

      1. Changes only the visual representation but the underlying value in F2 is the full date and it can be used in other calculations.

      2. The value in F2 is a text string and not a date.

      1. OMG! You are amazingly super smart. The 2nd option worked for my need and report :). I really appreciate your help. you are AWESOME!

  7. hello
    How to calculate Total Exp( Sample Format : 10 Years 6 Months & 12 Days)
    When i'm using DATEDIF() function it gives only year
    please give me the idea how i can get Sample Format : 10 Years 6 Months & 12 Days

    1. Hello Anusha,

      You can use the following formula:

      =DATEDIF(A2, B2, "y") &" years " &DATEDIF(A2, B2, "ym") &" months & " &DATEDIF(A2, B2, "md") &" days"

      Where A2 is the start date and B2 is the end date.

  8. I'd like to know if this is possible.
    I'm trying to get how many days are my computers hired in certain months.
    Say, 1 computer is hired from June 10 to July 20, 2016.
    Is their a turnaround/ formula on how to get the days hired in june and july in separate columns.
    So for june I get 20 days hired, and july 20 days hired.
    thanks!

    1. Dear Giovanni,

      (1)How is your data organised? Are the start dates and end dates in 2 columns? Is the name or ID of the computer mentioned in another column? Can you send the details of the data in brief?

      (2) In the period 10 June to 20 July, June has 21 days. Is the first day to be ignored?

      When posting a question, please be very clear and concise.

      Vijaykumar Shetye, Goa, India

  9. Hi,

    Thank you for giving such wonderful tips, i want to calculate daily productivity on excel like column A date column B references of accounts attended, how i can calculate number of accounts attended on a particular date.

    Regards,

    1. Dear Muzzamal Azeem,

      Use this array formula is column E
      =SUMPRODUCT(IF($A$1:$A$100=D1,1,0),IF(LEN($B$1:$B$100)>=1,1,0))
      Array formulas are entered with Control+Shift+Enter instead of Enter.

      List of dates is in column D, and your data is in column A to B, as you have mentioned in your post.

      A B C D E
      1 01/01/2016 A/C 01-Jan 2
      2 01/01/2016 A/C 02-Jan 4
      3 01/01/2016 03-Jan 4
      4 02/01/2016 04-Jan 5
      5 02/01/2016 A/C 05-Jan 3

      Vijaykumar Shetye, Goa, India

  10. please help me how to calculate the days from 15-5-2016 to 26-5-2016 excluding holidays falling in the first 5 days from 15-5-2016 to 19-5-2016

    1. Dear Ravish,
      Use the below formula
      =NETWORKDAYS(A1,A2,B1:B100)

      Cell references are as follows
      Start date in cell A1,
      End date in cell A2,
      List of holidays in cells B1 to B100.
      Change the cell references as required.

      Vijaykumar Shetye, Goa, India

  11. Dear Sir,
    How to calculate date value between two date.
    Vendor Name Item Qty Date
    AB POLE 20 10/5/2016
    AC POLE 50 15/05/2016
    ABC POLE 20 18/05/2016
    AB POLE 10 20/05/2016
    AC POLE 25 22/05/2016
    ABC POLE 30 24/05/2016
    ABC POLE 10 26/05/2016
    AB POLE 20 28/05/2016

    AB 50
    AC 75
    ABC 60
    Above the date sheet, i want the result if the qty purchase 50 pcs by ABC than shown date interval i.e.18-05-2016 to 26-05-2016

    1. Dear Praharsh Tiwari,
      Use the following Array Formula
      =B12&" "&SUMIF($B$3:$B$10,B12,D3:D10)&" "&TEXT(MIN(IF($B$3:$B$10=B12,$E$3:$E$10,999999)),"dd-mm-yyyy")&" to "&TEXT(MAX(IF($B$3:$B$10=B12,$E$3:$E$10,0)),"dd-mm-yyyy")

      I have entered it in C12. Change the cell references as required.
      To Enter an Array Formula, you have to click Control+Shift+Enter instead of Enter.

      A B C D
      Vendor Name Item Qty Date
      1 AB POLE 20 10/05/2016
      2 AC POLE 50 15/05/2016
      3 ABC POLE 20 18/05/2016
      4 AB POLE 10 20/05/2016
      5 AC POLE 25 22/05/2016
      6 ABC POLE 30 24/05/2016
      7 ABC POLE 10 26/05/2016
      8 AB POLE 20 28/05/2016

      10 AB AB 50 10-05-2016 to 28-05-2016
      11 AC AC 50 15-05-2016 to 22-05-2016
      12 ABC ABC 45 18-05-2016 to 26-05-2016

      Vijaykumar Shetye, Goa, India

  12. I need a column to determine who is a minor that (using YEARFRAC function) would automatically note who is minor.
    I attempted to inbed the YEARFRAC formula for age into an IF statement and it did not work. Here's my invalid formula: =IF(INT(YEARFAC(G4,TODAY())),'Minor', )

    1. Dear Sandy,

      (1) Kindly specify the age limit for declaring a person as 'Minor'.

      (2) Also mention if it is to be considered from 1Jan of any year or as per the current date.

      When posting a question, please be very clear and concise.

      Vijaykumar Shetye, Goa, India

  13. Hi there
    I'm trying to create a spreadsheet in excel that will highlight when a supervision is due

    For example - I want cell B2 to change to red 60 days after 01/01/2016
    I then want cell C2 to change to red 120 days after 01/01/2016

    I've been looking for a conditional format for weeks and am struggling

    Any help would be great

    1. Dear J Rogers,

      Select cell B2,
      Go to Home - Conditional Formatting - New rule - Use a Formula to determine which cell to format - Format values where this formula is true
      Enter the formula
      =B2+60
      Go to format - Fill
      Select Red colour
      Click OK twice

      Repeat the same for C2 and other cells
      The formula for C2 would be
      =B2+120

      Vijaykumar Shetye, Goa, India

  14. I would like to know if there is a formula that can continuously calculate dates: patients at a clinic are reviewed every 13 weeks from their admission date, with no set time for stopping the reviews. I would like a column to show the next review date, after the current review date has been passed. It will be a tool used so nobody misses out on their review (Dates here are dd/mm/yyyy).
    For example:
    Patient Name Admission Date Next Review Date
    John Doe 03/03/2016 02/06/2016
    Jane Doe 18/05/2014 14/08/2016

    Thank you.

    1. Dear Jess,
      If the admission date is in B2, then use the formula in C2 and drag it down.
      =B2+13*7 or
      =B2+91
      Change the format of the cell to the required date format.

      Vijaykumar Shetye, Goa, India

  15. I am trying to have my excel formulate each person on when 6 months is up on each of there training certificates once I enter a date in. I want it to automatically turn red once they are expired so I can notify them on when the last time they complete it.

    1. Highlight cells to be formatted (certificate dates).

      Go to Home > Conditional Formatting > New Rule.

      In the New Formatting Rule dialog box, click "Use a formula to determine which cells to format".

      Under "Format values where this formula is true", type the formula =(EDATE(B3,6))<TODAY() (where B3 is the top cell to be formatted. Even though only B3 is written, it will apply this to all cells separately).

      Click "Format".

      In the Colour box, select the red colour.

      Click OK until the dialog boxes are closed.

      Dates that are now past six months should be in red.
      I hope this helps.

  16. I am trying to add ranges in new tab that needs to show year ranges,pls advice
    Example is
    if order is in 2014 so it show >2 year
    If order is in 2015 result should be >1 year

    1. Hi!

      You can use a formula similar to this:

      =IF(YEAR(A1)=2014, ">2 year", IF(YEAR(A1)=2015, ">1 year", ""))

  17. I am trying to create a spreadsheet where it is giving back dates based off of the first date given. So say that B2 is a go-live date and B3 is a date specified by a formula given back based off of the date in B2. When B2 is erased, B3 turns to ####### because it now becomes a negative date. I can't seem to find a formula that will keep B3 blank until something is entered into B2.

    B2= a date
    B3 = B2-6

    This is basically a forecast on when things should be turned in prior to a go-live date.

    1. Use 1 of the below formulas as per your requirement
      =IF(B2-6<0,"",B2-6) or
      =IF(B2-6<0,"-",B2-6) or
      =IF(B2-6<0,0,B2-6)

      For NEGATIVE Values,
      First formula returns blank,
      Second formula returns dash (-) and
      Third formula returns 0 (zero)

      Vijaykumar Shetye,
      Goa, India

  18. How to Subtract the date in a cell, but if it has a same date it will compute as 1 day. Please Help.

    1. FORMULAS 1
      =IF(A1=B1,1,B1-A1) or
      where column B contains the final dates and
      column A contains the initial dates.

      FORMULA 2
      =MIN(B1-A1,1)
      gives same result as formula 1

      FORMULA 3
      =B1-A1+1
      This formula considers the first date as a complete day.

      If the text "days" is required after the value, then use one of the following formulas, example
      FORMULA 4
      =IF(A1=B1,1,B1-A1)&" days"
      The result of formula 4, will not remain a number.

      Vijaykumar Shetye,
      Goa, India

  19. Columns
    A - B - C - D - E - F - G - H - I.

    Columns A to G are descriptions, but I need to know what the next PM date is (in column I).I am trying to get Columns H & I to determine the date one year apart.
    Can you help me out with a formula for this?

    1. hi i would like to know how it use the formula if Mr. A start on 01 June and Mr. B start on 06 June but Mr. C start on 20 June so person who start from 01 to 17 of month we open salary on 22 June but from 18 to end of month open on 22 July.

    2. Dear Squirrelly,
      Enter the following formula in cell I1 and drag it down.
      =DATE(YEAR(H1)+1,MONTH(H1),DAY(H1))
      I have considered the PM date to be in cell H1.
      Format cell I1 to any date format required.

      Vijaykumar Shetye, Goa, India

  20. Hi i have to fill a date for first 19 rows as 1-jAN-2016 and after that i have to fill 2-jan-2016 for another 19 rows ,like that, i have to fill for a year up to December by dates is there any formula or how i can do it in excel? is it possible ?

    1. Dear EV,
      Enter the following formula in cell B4
      =IF(MOD(ROW()-4,19)=0,B3+1,B3)
      In the cell above B4, i.e. in cell B3, enter the date 31 Dec 2015.
      In case you want the formula in some other row, then replace the 4 in the formula with the new row number.
      Example if you enter the formula in cell b10, then replace 4 with 10.

      There are many other ways of doing this activity. Since you have mentioned about formula, I have given a formula for the same.

      Vijaykumar Shetye, Goa, India

  21. I have been try to find a formula to give a next start date. I have a create date and need to add 1 month to date to get my schedule date and the schedule date needs to be always 1 month ahead of the create date. any idea? thanks

    John Smith

    1. Use the formula
      =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))

      where the original date is in cell A1.

      Vijaykumar Shetye,
      Goa, India

  22. Hi,

    If I have a start date and end date, what is formula to check if it is expired or not

    1. Dear Rochelle,
      Use the formula
      =If(today()>=A1,"Expired","Not Expired")

      I have used cell A1 for end date. Change the cell reference as required.

      Vijaykumar Shetye, Goa, India

  23. March 31 2007 12.00 AM

    kindly tel me how to convert it in date format using formula in excel

    1. Option 1
      Select the cell,
      Go to Home - Format - Number - Date and
      choose 1 of the default date formats available

      Option 2
      Select the cell,
      Go to Home - Format - Number - Custom - Type and
      Type MMMM DD YYYY or any other date format required.

      It is generally advisable to use the default formats.

      Vijaykumar Shetye,
      Goa, India

  24. I HAVE USED FOLLOING FORMULA TO ADD YEAR IN excell
    =DATE(YEAR(G6)+50,MONTH(G6),DAY(G6)) but it works only if i entered year first than month & than day
    But it can not work if i entered day month & year as i have to work with date perfectly in no of cases so it is not possible to make data entry of date in following order year first than month & than day there is chance of mistake while data entry if ther is solution pl give guidence

    1. Microsoft Excel does not use the format of the date while calculating, but the numerical value of the date. The calendar year begins from 1 Jan 1900. Hence 1 JAn 1900 =1
      31 Jan 2016 = 42400.

      When you type the formula,
      =DATE(YEAR(G6)+50,MONTH(G6),DAY(G6))
      Excel detects that the year of 42400 is 2016, month of 42400 is 1 and the day of 42400 is 31. So I do not expect any error in the manner described by you.
      You may enter the date in any of the standard date formats available.

      I hope I have understood your query correctly.

      Vijaykumar Shetye,
      Goa, India

  25. Hi,
    Good Day!!!

    How can I convert the Hijri date to Gregorian date.
    I have tried different formula but do not work properly.
    Awaiting for your feedback... please

    Thanks & Regards.
    -Prem Neupane

    1. Dear Prem Neupane,
      There is no function in the Excel function list, to convert Hijri dates to Gregorian.

      To type a date in Gregorian format and have Excel interpret it as Hijri date:
      Go to Custom Format and enter B2dd/mm/yyyy.
      The date will be displayed as Hijri date.

      I recommend that you read the relevant documents on Microsoft Office Support and understand the precautions to be taken before you attempt to use this format.

      Vijaykumar Shetye, Goa, India

  26. Hello,

    I'm having a lot of difficulty creating a graph using the following data:
    12/20/2014 01:29.07
    2/7/2015 01:26.67
    2/28/2015 01:24.74
    10/25/2015 01:16.82
    11/7/2015 01:17.03
    11/21/2015 01:14.50
    11/28/2015 01:14.85
    1/9/2016 01:13.01
    2/6/2016 01:09.53
    2/13/2016 01:08.21
    3/13/2016 01:08.95

    Where column A contains dates and B contains times as minutes:seconds.hundredths

    I's like to have the times on the x axis if possible. I can get them on the y axis with a range, but I can't find an option to change the range if using x axis. Any help is greatly appreciated. Thanks.

    1. Dear Mike Wilson,
      If you are not finding an option to use x-axis, then probably you may not be using the scatter chart (or the X-Y chart).
      Kindly confirm that you are using the scatter chart.

      Vijaykumar Shetye, Goa, India.

  27. Is there any excel formula available to convert hijri date to Gregorian??

    1. Dear ZAHIR,

      for hijri date put in custom cell format B2dd/mm/yyyy and for Gregorian date
      put B1dd/mm/yyyy.

      you will find result.

    2. Dear Zhir,
      There is no function in the Excel function list, to convert Hijri dates to Gregorian.

      Type a date in Gregorian format and have Excel interpret it as Hijri date:
      Go to Custom Format and enter B2dd/mm/yyyy.
      The date will be displayed as Hijri date.

      I recommend that you read the relevant documents on Microsoft Office Support and understand the precautions to be taken before you attempt to use this format.

      Vijaykumar Shetye, Goa, India

  28. How can I use excel function to find age in dmy by subtracting his date of retirement from his date of birth

    1. Dear Soum,
      Your question is not clear. I have not understood why you want to find a persons age by using his retirement age.
      By subtracting a persons date of retirement from his date of birth, you will get a negative value.
      If you subtract the date of birth from his date of retirement you will always get the number of days equal to 21915 for a retirement age of 60 years.

      You can use the below formula
      =YEARFRAC(A1,B1,1)
      This will subtract the number of years from birth (cell A1) to retirement (cell B1). But again the answer will always by 60 or whatever is the retirement age.

      If you want to find age, use the formula
      =Today()-A1
      Format the cell as Custom Format Type dd mm yy.
      I am surprised by the requirement of this specific format. Eliminate the spaces between dd mm and yy if required.

      Vijaykumar Shetye, Goa, India

  29. Hello everyone!

    This might not relate to the topic but rather its a bit more advanced in nature. I'm working on a complex formula but I'm lagging cause of the dates.

    Let's assume that colum A contains different dates. Now, how do I get the date which is the latest of all but it should be less than the date I've picked.

    I hope my question is understood.

    1. Dear Abdul Hameed,
      Use the Array Formula
      =MAX(IF($A$1:$A$100<$B$1,A1:A100,0))

      Cell references are as follows.
      List of dates is in cells A1:A100,
      Reference date is in cell B1.
      Change the cell references as required.
      When entering an array formula, use Control+Shift+Enter, instead of Enter.

      Vijaykumar Shetye, Goa, India

  30. hello

    my wish is how could I ad 24 hours to date (12/03/2016) and receive in the other cell the new date , it is about a delivery time important to a client . I have tried different formula but do not work properly.

    with the best regards

    Pain

    1. Dear PAIN,
      When you add 24 hours to any date, it is equal to adding 1 to the date. In your case the result of 12/3/2016 + 1 should be =13/3/2016.

      Excel treats dates as numerical values, and merely displays the values in the format desired by us.
      The numerical value of one complete day 1 Jan 1900 is 1, since it the first day in the calendar which is used in Excel.
      The numerical value of the date 31 Jan 2016 is 42400, which means that it is the 42400th day after 1 Jan 1900.

      It seems to me that you have not expressed your query correctly.

      Vijaykumar Shetye

  31. i have a target date as 12/23/2015, If this date is falls between 12/01/2015 & 12/31/2015, then the cell should be updated as '2', else cell should update as '0'

    1. Hi Rocky,

      You can try the below formula for your question.

      =IF(AND(A1>=DATE(2015,12,1),A1<=DATE(2015,12,31)),"2","0")

      Where "A1" is your target date.

      Abdul

      1. 6^3+(4*3*2)+400 - 60= swhat is the answer?

  32. I have a cell with an expiration date for a contract. I need the row to change colors 60 days and another color 30 days, etc from the date. How would I create a conditional format for that one?

    1. Dear Pam K,

      Select the cell in which the expiration date is present, example B2.
      Go to Home - Conditional Formatting - New rule - Use a Formula to determine which cell to format - Format values where this formula is true
      Enter the below formula
      =IF(TODAY()>=A1+60,1,0)
      Go to format - Fill
      Select Orange colour
      Click OK twice

      Repeat the above with the below formula
      =IF(TODAY()>=A1+90,1,0)
      Fill Red colour.

      The rules are applied in the order shown. Hence the formula
      =IF(TODAY()>=A1+90,1,0) and format Fill Red colour should be above the other formula in the list. The order can be changes by using the arrows above the list.

      Change the cell references as required.

      Vijaykumar Shetye, Goa, India

      1. I needed a formula that would calculate today's date against a Due Date and change the cell color to yellow if it is between 60 and 31 days of the due date, and red if it is 30 days or less of the due date. This is the formula I placed in the Conditional Formatting for the cells:

        (For yellow cells) =IF($E2>=TODAY()+31,$E2<TODAY()+60)

        Which basically says, "Fill cell with yellow if today is between 31 and 60 days from due date (cell E2)."

        (For red cells) =$E2<=TODAY()+30

        Which is, "Fill cell with red if cell E2 is 30 days or less."

        I hope this answers someone's question because I could not find an answer anywhere. I was forced to learn formulas. LOL

  33. Request help in resolving following:

    1. Financial year (FY) is April-March i.e., “1-Apr-any year” to “31-Mar-next year” e.g., 1-Apr-2015 to 31-Mar-2016.

    2. Cell A1 should accepts any date, month and year (DMY) e.g., 21-Apr-1999 or 2-Jan-2006.

    3. Cell B1 by default should return corresponding FY end DMY i.e., “31-Mar-corresponding FY” e.g., 31-Mar-2000 or 31-Mar-2006 in point 2.

    Thanks

    1. Use the formula
      =DATE(YEAR(A1)+IF(MONTH(A1)<=3,0,1),3,31)

      Vijaykumar Shetye,
      Goa, India

      1. Request help in resolving following:
        Please help me:
        1. I want get result date confirm probation staff 3month after start join to work.
        Ex: date join : 12-jan-2017 but i want to know witch date he completed probation 3month

  34. One more if I may?

    Look in Column A (Row 1 thru 100) for a number less than 0
    If there is one, then look in Column B (Row 1 thru 100) to see if the date is between M1 and M2 - If so "yes", otherwise "no"...

    (I tried working with the formula you gave me for the holidays, but I'm obviously missing something because I can't get it...

    1. Use the formula
      =IF(AND(A1=E$1,B1<=F$1),"Yes","No")

      The start date has been entered in E1, and end date in F1.
      If you want different start date and end date for each row, then you may use E1 instead of E$1 and F1 in place of F$1.

      The signs =E$1 and B1<=F$1 may be eliminated if required.

      Vijaykumar Shetye,
      Goa, India

  35. HI,
    I'm looking for a formula to put "YES" in one cell when one of the dates from my holiday list falls between the payroll start and end date.

    I have holidays listed in cell A1 through A54

    I have the payroll start date in B2 and payroll end date in B3

    I'm trying to write a formula in C1 that says when any date from A1-A54 falls on or between B2 and B3 put "YES" in C1
    Any help ?????

    1. Hi Andrea,

      Try the following formula:

      =IF(COUNTIFS($A$1:$A$54, ">="&$B$2, $A$1:$A$54, "<="&$B$3)>0, "yes", "")

      1. Wow. Perfect. You wouldn't believe how long I spend googling for an answer. You are amazing !!!!! Thank you

  36. Great info that you have here. Please help. I am doing a scheduling order. I want excel to calculate a date for me that is the "first thursday closest to (but past) 60 days later. I already have the "today" date on the order. So I wanted the above to be at least 60 days away but it has to be a thursday. Then I will have two other cells that will take that date and add 14 days (pre-trial briefs date) and the other would add 28 days. (trial date). Thanks and keep up the great work. You are amazing!

    1. Hello,

      Thank you very much for your feedback.

      Please try to use the following formula:
      =A2+70+(IF(WEEKDAY(A2+60)<=5,5-WEEKDAY(A2+60),5-WEEKDAY(A2+60)+7))
      Here A2 is the cell with the initial date.

  37. in A1 I have a date in dd:mm:yy. In A2 i want to build formula which will accept only date greater than A1. If earlier date is entered, it should return "INVALID".
    Please help.
    Thanks.

    1. Hello Mahesh,

      You can use the standard Data Validation tool in Excel:
      - Select cell A2
      - Go to Data tab in Excel and click on Data Validation
      - Select "Date" in the "Allow" list
      - Select "Greater than" in the "Data" list
      - Select A1 as the "Start date"
      - Enter the Input message and Error Alert if necessary, click Ok.

      1. Hello Irina,
        Thanks for your answer and help. It works.

  38. Hi Svetlana Cheusheva,
    I need one more help.. that is about auto increment calculation.. the situation is " when an employee completes his one year in a company, he will get 5% increment on his basic salary " so is it possible in excel to calculate this?
    if you send me your email id, i can send you an attached salary sheet that i preparing.

    thanks

    1. Mahmud,

      You can use a formula similar to this:

      =IF(DATEDIF(A1, TODAY(), "y")>=1, B1*1.05, B1)

      Where A1 is an employee joining date, and B1 is that employee basic salary.

      Please note, the formula increments the basic salary by 5% for all employees that have worked one or more complete years.

      1. Svetlana

        thanks

        its working as you say one or more complete years but if here the increment add after every one year.that means after every one year the basic will increase 5%. is it possible?

        thanks for your continuous support.

  39. Hi,
    Can i use a formula in excel to calculate year & month ? as example: an employee joining date is 1/23/2015 . so excel will show that today he complete his (1 year) of job in this company ..... is it possible?

    thanks

    1. Hello Mahmud,

      You can use the DATEDIF function to calculate the complete years and months. For example:

      Complete years: =DATEDIF(A1, TODAY(), "y")

      Complete months: =DATEDIF(A1, TODAY(), "y")

      Where A1 is an employee joining date.

      1. Hi. i already get the days aging of my file. also, if the column is delivered i want to display on aging column ( - ) not the number of days aging.

        please help me.

        aging column item description date request status

        sample header above.

        thank you

      2. Its working... thanks.. =DATEDIF(A1,TODAY(),"Y"&"YEARS"

  40. How would I go about trying to use a formula to project the time and day that a material would be completed? My example would be If my ending total is 5000 and I knew that I go through 250 per day and today is Tuesday 8 pm. What would my formula be? Greatly appreciated!

    1. Hello Billy,
      You can use the following formula:
      =D6+(F6/E6)

      Here D6 is the cell with the start date, F6 is the cell with the ending total, and E6 is the cell with the value you'd accomplish every day.

      Please make sure you set the cell format to Date with time, e.g. 3/14/12 1:30 PM.

  41. Request you to help in below date format...

    Sample : 24121550200128

    First 6 digit is date like 24.12.15.

    how can i bifurcate date 241215 to 24.12.2015 in one formula...

    1. Hello Chintan,
      You can use the following formula:
      =CONCATENATE(MID(K3,1,2),".",MID(K3,3,2),".",MID(K3,5,2))

      You'll need to replace K3 with the necessary cell address.

      1. Dear senior thank u my doubt also clear

  42. How do you add years to a current date to find new date (i.e., 01/01/2015 + 15 = 01/01/2030

    1. Hello,

      You can use the following formula to add years to the current date:
      =DATE(YEAR(TODAY())+15, MONTH(TODAY()), DAY(TODAY()))

      You can also replace TODAY() with a reference to a cell with a date.

      1. Thank you.. this worked perfectly! I calculated my client's 18th birthday with this and their DOB. =DATE(((1997)+18), 1, 15).

      2. Hi Irina,

        I was looking for the same solution as HR, but I still cant get the result.
        Date format is 19.10.2016. in C3 cell, and I have to add 6 months so the formula should be:
        =DATE(YEAR(C3), MONTH(C3)+6, DAY(C3))
        but I get only pop up message that something is wrong.
        Can you please help me?
        Thanks.

  43. i want to insert a formula for converting date into day
    exa. 27/12/2015= sunday
    plz sugges

    1. Hello Preetam,

      You can use the following formula to return the day of the week:

      =TEXT(A1,"dddd")

      Here A1 is the cell with the date.

      1. Hello Irina,

        I want to increment the day without incrementing the month in cells along in a raw (in A1,B1,C1,D1,E1...)etc...

        =TEXT(WEEKDAY(DATE(CalendarYear,2,6),1),"aaa")

        Please suggest.
        Thx!

      2. Date taken For calculation of Invoice submission ( MS Approved date or Hoto date which ever is later)
        INVOICE SUBMISSION DATE-01/06/2016

        MS APPROVED DATE-12/05/2016

        HOTO DATE-18/05/2016

        HOW TO CALCULATE THEM WITH THE HELP OF FORMULA

  44. I am trying to convert text, imported from a report in a another program to a date. The text reads "January 1 2015". It will only recognize it as a date with a comma. I do not want to go in by hand to add the comma by hand in 100s of cells.

    1. Hi Kate,

      Please add a column next to the original one, set the cell format to dates, and paste the following formula into the new column:
      =DATEVALUE(SUBSTITUTE(A2," ",", ",2))

      Here A2 is the cell with your text. Copy the formula down to get the dates you need.

  45. I've spent a week or so looking for a formula. I recently came across you site. It's really good explaining excel. Thx. Can you help with my issue:

    Column A is descending non consecutive dates.
    Column B is prices.
    In colum C I want to add all the prices of Column B if they are between two dates in Column A
    So basically all the $ spent in a weeks in column C

    I assume some combination of vlookup, datevalue, if.
    thank you

    1. Hello Scott,

      Thank you for your feedback!

      You can try using the following formula for your task:
      =SUMIFS(B1:B7,A1:A7,">1/1/2015",A1:A7,"<1/10/2015")

      Here B1:B7 is the range with the prices, A1:A7 is the range with dates, and the dates in quotes are the conditions for summing values in column B. Thus it sums values in column B if the dates in column A are between January, 2 and January, 9.

      1. HI IRINA,
        Why i try to use your formula above, but still cant work? actually i need do one formula, for calculate from 1st Nov to 30 November total quoted amount
        Please advise. thanks

Post a comment



Thanks for your comment! Please note that all comments are pre-moderated, and off-topic ones may be deleted.
For faster help, please keep your question clear and concise. While we can't guarantee a reply to every question, we'll do our best to respond :)