+ Reply to Thread
Results 1 to 11 of 11

please help me add 1, 2 or 3 years to a date in Excel (O365)

  1. #1
    Registered User
    Join Date
    10-22-2018
    Location
    London
    MS-Off Ver
    O365
    Posts
    3

    please help me add 1, 2 or 3 years to a date in Excel (O365)

    Hi All

    I have a spreadsheet with dates in it that i would like to add either 1, 2 or 3 years to. There is a cell that lists if the customer bought a 1, 2 or 3 year licence so i need the formula to check that cell and then add the number of years.

    I started with this =DATE(YEAR(F2)+1,MONTH(F2),DAY(F2)) but i can't make a formula that checks a cell and then adds that number of years.

    Any help or advice would be most welcome. Thank you

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Hello and welcome to the forum.

    Since 1 year is 12 months, I would use something like this:

    =EDATE(F2,A1*12)

    Where your date is in F2 and the number of years to add is in cell A1.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Try this:

    =DATE(YEAR(F2)+CHOOSE(A1,1,2,3),MONTH(F2),DAY(F2))

    A1 is the cell with either 1, 2 or 3 in it.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    10-22-2018
    Location
    London
    MS-Off Ver
    O365
    Posts
    3

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Thank you both but i get an #VALUE! error using both methods

    The original DATE field is UK format 15/08/2018 if that helps

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Then you are not doing either correctly. Unless, of course, F2 does not really contain a date, but just text. Best attach the workbook.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

  6. #6
    Registered User
    Join Date
    10-22-2018
    Location
    London
    MS-Off Ver
    O365
    Posts
    3

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Thank you so much for your help, i can see my mistake now.

    In the field that has the number of extra years to add it has the number followed by the word years;

    1 Year
    3 Years
    3 Years

    Any suggestions how i can just extract the first character?

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Like this:

    =DATE(YEAR(F2)+CHOOSE(LEFT(A1,1),1,2,3),MONTH(F2),DAY(F2))

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    =edate(f2,left(a1)*12)

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Ali, wouldn't CHOOSE(A1,1,2,3) where A1 = 1, 2, or 3 be the same as simply using A1?

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Administrative Note:
    HTH
    Regards, Jeff

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: please help me add 1, 2 or 3 years to a date in Excel (O365)

    Quote Originally Posted by 63falcondude View Post
    Ali, wouldn't CHOOSE(A1,1,2,3) where A1 = 1, 2, or 3 be the same as simply using A1?


    Erm, yeeees ... oops!

+ 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. Replies: 4
    Last Post: 03-02-2018, 10:49 AM
  2. Excel table date filter not show all years to select
    By ericbsw in forum Excel General
    Replies: 8
    Last Post: 07-21-2017, 04:45 PM
  3. Outlook screen blank in O365 mode
    By saamer in forum Office 365
    Replies: 0
    Last Post: 09-18-2013, 10:04 AM
  4. iCloud in O365
    By a2fire2i in forum Office 365
    Replies: 0
    Last Post: 09-12-2013, 02:21 AM
  5. Replies: 4
    Last Post: 11-19-2010, 11:17 AM
  6. Excel =Date and Leap Years
    By thesonofdarwin in forum Excel General
    Replies: 10
    Last Post: 06-15-2010, 03:31 AM
  7. [SOLVED] Excel Adding years or months to a date
    By Joan in forum Excel General
    Replies: 2
    Last Post: 04-25-2005, 04:06 PM

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