+ Reply to Thread
Results 1 to 4 of 4

Thread: Compare two dates and possibly third if it exists to confirm <30 days

  1. #1
    Registered User
    Join Date
    02-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Compare two dates and possibly third if it exists to confirm <30 days

    Hello. I've been trying to figure out a formula to compare three dates, when at times all three are not always present.

    #1 - initial
    #2 - secondary
    #3 - final

    There is always an initial and a final and the number of days between needs to be 30 or less. If there is a secondary date present, then the calculation needs to work from the final to the secondary to determine if the number of days is 30 or less. If there isn't a secondary date present that field will contain "N/A".

    I've added extra columns and did summary calculations
    final - initial = D3
    final - secondary = E3

    and then wrote the below, but that doesn't include situations when the secondary doesn't exist. It also adds extra columns to the spreadsheet which is undesirable.

    =IF(D3>E3,IF(E3>30,"Late","ok"))
    Attached Files Attached Files
    Last edited by llamb; 02-02-2012 at 11:51 AM. Reason: (I was just told the secondary date field doesn't contain a date it will contain text "N/A")

  2. #2
    Forum Guru
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    5,359

    Re: Compare two dates and possibly third if it exists to confirm <30 days

    Hi

    Try this
    =IF(AND(LEN(B3)=0,C3-A3>30),"NoInterim, >30",IF(C3-B3>30,"Interim,>30","OK"))

    Note that in cells B7 and B9 you have a " ". Make sure you remove that space so that it is completely blank.

    rylo

  3. #3
    Valued Forum Contributor
    Join Date
    12-05-2011
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    213

    Re: Compare two dates and possibly third if it exists to confirm <30 days

    Hi

    Try this in cell F3, copied down:
    =IF(C3-MAX(A3,B3)>30,"Late","ok")
    This can handle the N/A in Column B, unless this is the Excel, #N/A error. If it is an error code, not just text, you will need to modify the formula to:
    =IF(C3-MAX(A3,IF(ISERROR(B3),0,B3))>30,"Late","ok")
    Cheers, Rob.
    Last edited by rscsmith; 02-02-2012 at 05:13 PM.

  4. #4
    Registered User
    Join Date
    02-02-2012
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Compare two dates and possibly third if it exists to confirm <30 days

    Quote Originally Posted by rscsmith View Post
    Hi

    Try this in cell F3, copied down:
    =IF(C3-MAX(A3,B3)>30,"Late","ok")
    This can handle the N/A in Column B, unless this is the Excel, #N/A error. If it is an error code, not just text, you will need to modify the formula to:
    =IF(C3-MAX(A3,IF(ISERROR(B3),0,B3))>30,"Late","ok")
    Cheers, Rob.
    Rob! This works like a CHARM!!! Thank you so very much. You've completely saved the day!!

+ 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.2.0