+ Reply to Thread
Results 1 to 5 of 5

Calculating yearly start dates ignoring leap years

  1. #1
    Registered User
    Join Date
    02-25-2015
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    3

    Calculating yearly start dates ignoring leap years

    I am trying to calculate the start date for option years on a contract that could have anywhere from 1 to 4 option years. I have blocks in my worksheet representing the base contract year start date (A1), base contract year end date (A2) and the final contract year end date (A3). My 1st option year start date formula is =DATE(YEAR(A1)+1,MONTH(A1),DAY(A1) and this works great. My second year start date formula is =DATE(YEAR(A1)+2,MONTH(A1),DAY(A1) but if the result of this formula is greater than the final year end date I want the block to show N/A and I cannot figure out how to do this.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Calculating yearly start dates ignoring leap years

    Can you show what you're trying to do with sample workbook? To upload click "Go Advanced" button and find paperclip button to attach the file.

    regards

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating yearly start dates ignoring leap years

    You could possibly shorten your formulas by using EDATE, e.g. to get a date one year later than A1 you can use this formula

    =EDATE(A1,12)

    If you want to show N/A when that's later than A3 you can use this version

    =IF(EDATE(A1,12)>A3,"N/A",EDATE(A1,12))

    For 2 years just use 24 in place of 12
    Audere est facere

  4. #4
    Registered User
    Join Date
    02-25-2015
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    3

    Re: Calculating yearly start dates ignoring leap years

    I have inserted some data in the blue/gray boxes so that data would populate in the green shaded box.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-25-2015
    Location
    Pennsylvania
    MS-Off Ver
    2013
    Posts
    3

    Re: Calculating yearly start dates ignoring leap years

    Thank you daddylonglegs, this worked perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Auto populate dates to figure in for leap years
    By SethS in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-08-2014, 06:49 AM
  2. [SOLVED] Age based on DOB; Accounts for leap years. Years old if >2, Months if <2 years old.
    By sharpmel in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-17-2013, 04:20 PM
  3. Dates and Leap Years
    By JEA in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-05-2011, 11:03 PM
  4. Date Differences and ignoring Leap Years
    By kieran54055 in forum Excel General
    Replies: 2
    Last Post: 09-20-2010, 11:51 AM
  5. [SOLVED] Calculating days between dates and leap years
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 03-17-2005, 12:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1