+ Reply to Thread
Results 1 to 7 of 7

Calculating lowest date from two cells

  1. #1
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Calculating lowest date from two cells

    Hi guys -

    I have two cells with dates, lets say A1 and B1, and I want to put the lowest (earliest) date in cell C1, however, there are several conditions:

    IF both cells are empty, return NO DATES
    =IF(AND(A1="",B1=""), "No Date")

    IF B1 is blank, and A1 is not blank, return A1
    =IF(AND(B1="", A1<>""), A1)

    IF A1 is blank and B1 is not blank, return B1
    =IF(AND(A1="", B1<>""), B1)

    IF boths cells are not blank, and A1 is lower than B1, return A1
    =IF(AND(B1<>"", A1<>"", A1<B1), A1)

    IF boths cells are not blank, and B1 is lower than A1, return B1
    =IF(AND(A1<>"", B1<>"", B1<A1), B1)

    IF both cells are not blank, and A1=B1, return A1
    =IF(AND(A1<>"", B1<>"", A1=B1), A1)

    I can think of the individual formulas, but any more and my brain melts. I

    put them all in separate columns, so I get loads of FALSES, and return the column with a date using MIN, but this is a crap way of doing it, it takes up loads of space, and if both dates are blank the MIN function gives me 1/0/1900.

    Whats the best way of doing this please?

    THANKS!!!!
    Last edited by john_london; 01-21-2011 at 12:34 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculating lowest date from two cells

    Presumably the cells either hold valid dates or are blank (or at least non-blank non-dates should be ignored)

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Calculating lowest date from two cells

    Maybe:

    =IF(COUNT(A1:B1)=0,"No Date",MIN(A1:B1))

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Calculating lowest date from two cells

    @Cutter, much better... time for bed

  5. #5
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Calculating lowest date from two cells

    Thanks DO!

  6. #6
    Registered User
    Join Date
    04-19-2010
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Calculating lowest date from two cells

    Genuis!!! Thanks!!

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Calculating lowest date from two cells

    You're welcome.

    Don't forget to mark it as SOLVED.

+ 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