+ Reply to Thread
Results 1 to 8 of 8

IF function with date values

  1. #1
    Registered User
    Join Date
    06-04-2012
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2016
    Posts
    8

    IF function with date values

    Can someone help me with IF Function formatting for dates? Specifically I'm looking for a way to use the IF Function to post a date of one year (365 days) past the given cell value, or 9/15/2012, whichever is later.

    For example, IF ((A4) + 365) < (TODAY) then return 9/15/12, else return (A4) + 365.

    Having trouble formatting it exactly right to get the value I want, though. Thanks!

    -Paul
    Last edited by paul16451; 06-04-2012 at 12:42 PM. Reason: error in 1st post

  2. #2
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: IF function with date values

    Is this what you want

    =IF((A4+365)<TODAY(),A4,A4+365)

    I'm assuming A4 contains the date
    If I helped, please don't forget to add to my reputation. (click on the star below the post)

    If the problem is solved, please: Select Thread Tools (on top of your 1st post) -> Mark this thread as Solved.

    Failure is not falling down but refusing to get up.

  3. #3
    Registered User
    Join Date
    06-04-2012
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: IF function with date values

    Yes, A4 contains the date. But that formula does not work...it only returns A4 + 365 no matter what date entered. I need it to return a specific, set date (9/15/12) if A4 is older than a year. For example, if I enter the date 6/23/11 or 10/21/10, or 3/13/09, in all those cases it should return 9/15/12. But if I enter 5/13/12, it should return 5/13/13. In other words, it should only return A4 + 365 for recent dates a year or less. In all other cases, it should return 9/15/12.

  4. #4
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: IF function with date values

    Does this work for you?

    =IF((A4+365)>TODAY(),A4+365,C4)

    Put 9/15/12 in C4 or any suitable cell and adjust formula.

    You gave a bad example with 6/23/11 because that is less than a year from today

  5. #5
    Registered User
    Join Date
    06-04-2012
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: IF function with date values

    oh yes I did...apologies for that bad example.

    But I'd rather not have to put additional data into an extra cell that has no other purpose in the worksheet other than for a function. Is there a way to build the set date directly into the formula above?

  6. #6
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: IF function with date values

    =if((a4+365)>today(),a4+365,"09/15/2012")

  7. #7
    Registered User
    Join Date
    06-04-2012
    Location
    Sunnyvale, CA
    MS-Off Ver
    Excel 2016
    Posts
    8

    Re: IF function with date values

    That works, thank you.

    -Paul

  8. #8
    Forum Contributor Russell Dawson's Avatar
    Join Date
    03-01-2012
    Location
    Yorkshire, England
    MS-Off Ver
    2007
    Posts
    608

    Re: IF function with date values

    No problem Paul.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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