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 20. Total comments: 684

  1. Hi there

    I have a sheet that we use for targets. Now if you pick a month it should run from the 11th to the 10th of the following month. My formula works fine but when a month has 30 days or 29 or 28 days it will run till the 12th or 11th instead of stopping at the 10th. How do I limit it to end till the 10th of each month.

  2. 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!

  3. HI there,

    I am currently creating a schedule where I want to go back 1 week -10 daysfrom a numerical date in a cell, but within that one week-10 days I want excel to choose the wednesday furthest back, how would I go about doing that.

    Say my due date is September 1, 2016, going back 10 days will take me back to August 22 (monday). I want the cell to compute Wednesday, August 24. I have different dates to set up so it'll never be consistent like 5 days before etc. and I don't want to have to change for each instance.

    Any help would be greatly appreciated!

  4. hi,

    i need some help/tip in calculating difference between two dates in one cell. i also try datedif formula but in office excel 2007 is don't exists. i am also look for help for converting 'ddmmyyyy'(7121985/31052005) in 'dd-mmm-yy'(07-Dec-85/31-Mar-05). I required all this for excel sheet 2007. Please help me.../////

  5. Hii

    equation for showing a particular date for a dategroup(means a week or a countious 5 days, workdays etc)

    eg:01-05-2016 to 05-05-2016 is shown in a cell as 01-05-2016.

  6. Hi,

    I hope you can help me with my problem, i have a Received date and Fixed date in Cell A1 and B1, i need to calculate if A1 starts at <or=8:00 AM to 4:00 PM,maybe we can put it in C1 as Yes and for No. Then another calculation is closing Date if all Yes in C1 is closed at 5:00 PM, in No Calculate if closed within 24 hours. This except Sat and Sun.

    Regards,
    Dennis

  7. I would like the return value of the cell to be the start of the current year if an employee started prior to the year starting and if they started within the year to return their hire date. Can you assist?

  8. 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.

  9. 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

  10. 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

  11. 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

  12. Hi there,
    I need some help with calendars. I manage rent payments and one of the tenants does not speak English well.
    I have the dates she paid her rent in column A and it starts from 2014 until now.
    I would like to show her a calendar indicating, when she did not pay on time.
    Therefore I would need a calendar like
    S M T W T F S
    1 2 3 4 5 6
    7 8 9 ......

    and a formula which tells the calendar which cell to highlight for rent payments, means the dates from column A.

    Is there an option for this?

  13. 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

  14. I ma trying to develop a schedule that will be comprised of six 10 day parts depending on the start date and holidays. I want to be able to change the start date and have the six parts provide the start and end dates for each part. To clarify, if there is a holiday in one of the parts I want to have that day subtracted from the total (instead of added) so that there would be fewer working days (than 10) and the dates would reflect this difference for any parts that have holidays otherwise the part should be 10 days. Example: Start June 29, 2016 10 days =WORKDAY(June 29 2016,10, July 4, 2016) returns July 12 I need for it to return July 8, 2016 which is 10 working days from June 29 minus 1 day for the holiday.

  15. Hello,

    I am currently updating my company's Excel files. I wanted to add the day's date in a cell if a project is marked completed. ive' used the following formula: =IF(ISTEXT(U:U), NOW(), ("")). it worked but I am facing a problem. the projects that were marked completed had the date in the cells next to them but the dates keep changing to today's date or the current day i open the excel file. can you please help me with telling me the right formula to add an unchanging date using IF function?

    Thank you,
    Maan

  16. 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

  17. 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

  18. how to + n _ date format in excel 12/11/2016
    10/12/2011

  19. Hi,

    I am calculating pension between two dates on yearly basis for staff whom are leaving the organization. I could use this formula to do that but, the employee is doing the calculation manually so it shows slight difference.

    Can anyone help please!

    =IF((YEAR(G13)<YEAR(TODAY())),(P27/365*(U13-DATE(YEAR(TODAY()),1,1))))

    G13 is joining year;
    P27 is current salary;
    U13 is separation date;
    DATE(YEAR(TODAY()),1,1))))is January 1, of each year;
    The Salary is AFS 20,000.00 per month;

    Based on this formula the pension amount from January 1, 2016 to May 31, 2016 is AFA 8,273.97 and based on manual calculation it is =AFA 20000/12*5= AFA 8,333.33 and difference is AFA 59.36

    Your soonest rely will be highly appreciated!

    Ahmad

  20. 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

  21. Hello, I would like to know how to calculate the requested room nights per day, for example to achieve the given budget for the month.

    thank you

  22. I have cell A1 that is formulated to give an answer for duration (year, month, day) as follow
    =IF(DATEDIF(F17,$G$17,"y")=0, "", DATEDIF(F17,$G$17,"y") & "Y ") & IF(DATEDIF(F17,$G$17,"ym")=0,"", DATEDIF(F17,$G$17,"ym") & "M ") & IF(DATEDIF(F17,$G$17, "md")=0,"", DATEDIF(F17,$G$17, "md") & "D")

    Example of results:
    6M
    11M 19D
    3Y 2M
    10Y 8M 21D

    I need a new cell which will give answer to the following criteria;
    If duration is less than 2 years = A, if duration is more than 2 years = B and if duration is more than 5 years = C

    Is there a formula to this?

    Thanks.

  23. 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.

  24. I am trying to subtract & add 2000$ to the total with in a specific period of say 2 months
    Example
    I have taken loan for 10000 on 1/1/16, I am going for leave for 2 months vacation on 2/02/16 so from this date onwards the total amount to be reduced by 2000/- & later after 2 months it should automatically added to become 10000/-

  25. PLZ HELP ME SIR/MADAM WHEN EXCEL SHEET DATE COVERT TO DATE BUT 30 DAYS FORWARD AUTOMATIC BUT WHY PLZ REPLY THANK YOU.

  26. 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", ""))

  27. 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

  28. 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

  29. Hi
    I have this scenario where in column A I have the date (04/25/2016) and in column B I have the time (12:46 PM)
    I am trying to find a formula where I can change the date and time when the time mentioned in the column B is 3:00 Pm or above and it should reflect the next day in the date column with 7:00 AM as the time in Column B.

    Example : column A - Column B
    04/25/2016 - 3:00 PM
    It should change to
    04/26/2017 - 7:00 AM

  30. 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

  31. 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

  32. 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

  33. I am trying to track training and have the cells change color as the expiration date approaches. So Equal Opportunity Training was conducted 01 Feb 2016 and will expire 01 Feb 2017. If I enter 01 Feb 2016 in the cell what formula do I need to enter to get the cell to turn red on 01 Feb 2017, turn yellow 01 Nov 2016, and be green from 01 Feb 2016 to 31 Oct 2016. And I understand this will most likely occur under conditional formatting.

  34. 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

  35. 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

  36. Hi, I am trying to figure it a formula to figure out certificate expectation dates, one cert ends in 5 years and one ends in 10years the column I contains the date the certificate was completed and column J contains type of certificate ex: Cert Apple is 5years and Cert B is 10years. How do I create a formula to figure out when they are close to expiring 90,60,30 days out

  37. 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

  38. 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

  39. I am responsible for sending out a daily sales dashboard for my departments sales. I have a two tab worksheet. Tab one is graphical representation of tab twos formulas. On tab two I have three columns (date, actual sales, and goal). I am attempting to find a formula for tab 1 to automatically grab data from column b and c (actual sales, goal) based on today's date. For example if it is March 28th the formula will find March 28th sales and goal numbers on column b and c of tab 2.

  40. 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.

  41. 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

  42. Can you explain what the denominator of this formula is calculating?
    =(B5/((DATEDIF((DATE(1899,12,31)+(0*7+IF(B2>60,B2-1,B2))),TODAY(),"D"))))

    This came from a spread sheet I am working with that is labeled change/day.

    1. Below is the explanation of the denominator.

      The DATEDIF function returns the difference between two dates.
      The unit can be specified as days, months or years.
      (For detailed information, refer https://www.ablebits.com/office-addins-blog/excel-datedif-calculate-date-difference/).
      The end date must always be greater than the start date, otherwise the Excel DATEDIF function returns the #NUM! error.

      In your formula, the START DATE is the sum of the following 3 parts.
      1. DATE(1899,12,31),
      2. 0*7 and
      3. IF(B2>60,B2-1,B2)
      Let us understand each part separately.

      PART 1 OF START DATE.
      DATE(1899,12,31)
      The DATE function returns the sequential serial number that represents a particular date, when the year, month and day are mentioned.
      (For detailed information, refer https://www.ablebits.com/office-addins-blog/excel-date-functions/)
      If year is between 1900 and 9999 (inclusive), Excel uses that value as the year.
      If year is less than 0, or greater 9999, then Excel returns the #NUM! error value.
      In your formula, the year is 1899, month is 12 and the day is 31.
      Hence, the date is returned as 31/12/3799. The numerical value of this date is 693962.
      Note that, 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.

      PART 2 OF START DATE.
      0*7 is zero, since any number multiplied by zero is zero. Hence this part does no activity at all.

      PART 3 OF START DATE.
      IF(B2>60,B2-1,B2)
      If, B2 is greater the 60, then it takes "B2 minus one" as the value. If B2 is less than or equal to 60, then it takes "B2" as the value.

      So our START DATE is = 693962 + 0 + (B2-1 or B2)

      The END DATE in the formula DATEDIF is "TODAY"

      The unit used “D”. So the result is given in number of days.

      The value of the start date is so large, that it is almost certainly going to be larger than the end date. The end date must always be greater than the start date, otherwise the Excel DATEDIF function returns the #NUM! error.

      With so many errors in it, I would not have used the formula in the current form. I strongly recommend editing the same.

      Vijaykumar Shetye,
      Goa, India

  43. 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

  44. 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

  45. 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

  46. 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?

  47. 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

  48. 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

  49. 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

  50. I have set up a tracker for holidays taken and booked ,sick days and toil my problem is i need a formula that updates the holiday column when the date the holiday is booked for is reached eg 23 days per year,10 days booked for 3-13 march how can i get this to update automatically instead of me having to change it from booked to taken?

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 :)