+ Reply to Thread
Results 1 to 6 of 6

If new date is greater than predetermined date, use predetermined date

  1. #1
    Registered User
    Join Date
    10-01-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    If new date is greater than predetermined date, use predetermined date

    Not an excel junkie at all . In the attached sheet under Type of Expiration drop list; "Stipulated" is expiration dates read off the bottle so that is typed in as is, if it's "Absent" then 7 years is assigned from date received. Well and good, but I need help with "Issued". "Issued" is supposed to be 5 years from today/day selected/day opened but not beyond 7 years from date received (Only applies to item that were previously tagged "Absent"? Any assistance will be appreciated. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: If new date is greater than predetermined date, use predetermined date

    So you're focusing on this section of your uploaded file?
    G
    H
    I
    5
    Expiration Date (Absent) EXP/OK? Batch No
    6
    NA
    OK
    7
    12/2/2016
    OK
    8
    FALSE
    OK
    9
    9/25/2016
    OK
    10
    1/17/2014
    EXP
    11

    You might have to "draw" me a timeline.

  3. #3
    Forum Contributor
    Join Date
    03-17-2005
    Location
    Canterbury, Kent
    MS-Off Ver
    2003, 2010
    Posts
    285

    Re: If new date is greater than predetermined date, use predetermined date

    Not sure if this helps but add another if statement to column G
    =IF(C8="Issued",(DATE(YEAR(D8)+5,MONTH(D8),DAY(D8))),IF(C8="Absent",(DATE(YEAR(D8)+7,MONTH(D8),DAY(D8))),IF(C8="Stipulated","NA")))
    This should give the 5 years.

    Then look at adding another if statement to column H to check if it is over 7 years.

  4. #4
    Registered User
    Join Date
    10-01-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: If new date is greater than predetermined date, use predetermined date

    Yes FlameRetired, am focusing on that section. Windy58, that statement is only correct if adding 5 years from today for "Issued" is allowed to go beyond the 7 years from "Absent". Expiration dates for "Issued" are + 5yrs from today but cannot jump over 7 yrs from date received. So the column G dates have a 7 yr limit from column D.

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

    Re: If new date is greater than predetermined date, use predetermined date

    You can perhaps use EDATE to add years and shorten the formula a little.......then this version should do what you want

    =IF(C6="Absent",EDATE(D6,12*7),IF(C6="Stipulated","NA",IF(C6="Issued",MIN(EDATE(TODAY(),12*5),EDATE(D6,12*7)))))

    If C6 = Issued the formula calculates the earliest date out of TODAY+5 years and D6+7 years
    Audere est facere

  6. #6
    Registered User
    Join Date
    10-01-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    3

    Re: If new date is greater than predetermined date, use predetermined date

    Quote Originally Posted by daddylonglegs View Post
    You can perhaps use EDATE to add years and shorten the formula a little.......then this version should do what you want

    =IF(C6="Absent",EDATE(D6,12*7),IF(C6="Stipulated","NA",IF(C6="Issued",MIN(EDATE(TODAY(),12*5),EDATE(D6,12*7)))))

    If C6 = Issued the formula calculates the earliest date out of TODAY+5 years and D6+7 years
    Thanks a lot, this solves it.

+ 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] VBA Macro to Color Row Text If Date in Cell is greater than system date
    By slick9456 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-24-2014, 06:09 PM
  2. [SOLVED] Macros for: If Today's Date minus other date is greater than certain amount of days Then
    By lottidotti in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-24-2012, 04:46 PM
  3. Replies: 5
    Last Post: 07-03-2012, 01:23 PM
  4. Replies: 6
    Last Post: 12-12-2011, 09:07 PM
  5. Replies: 4
    Last Post: 09-01-2011, 03:25 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