+ Reply to Thread
Results 1 to 6 of 6

Using "IF" and todays date

  1. #1
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Using "IF" and todays date

    Hi.

    I can't quite make this work.

    Basically I want to be able to return a result based on whether the date in a cell is in the past or not.

    So, Cell I5 will have a date in it. I need Cell J5 to return a result of "Closed" if the date is prior to today, or just return the date in Cell I5 if it is either today or in the future.

    I tried something like this: =IF(I5<TODAY(),"Closed") but I can't get it right

    Any suggestions?

    Cheers

    Andy
    Last edited by NBVC; 07-20-2010 at 11:49 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "IF" and todays date

    Is it not giving the "Closed" or not giving the item in I5?

    Try:

    =IF(I5<TODAY(),"Closed",I5)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Using "IF" and todays date

    Quote Originally Posted by NBVC View Post
    Is it not giving the "Closed" or not giving the item in I5?

    Try:

    =IF(I5<TODAY(),"Closed",I5)

    Hi. Thanks very much for your quick reply.

    I tried this on several rows where the date was in the past, it's just returning the date in I5....

    It doesn't seem to be validating it against the <Today()

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "IF" and todays date

    Is I5 really a date or is it a text sting?

    Does this work?


    =IF(I5+0<TODAY(),"Closed",I5+0)

  5. #5
    Registered User
    Join Date
    05-22-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Using "IF" and todays date

    Quote Originally Posted by NBVC View Post
    Is I5 really a date or is it a text sting?

    Does this work?


    =IF(I5+0<TODAY(),"Closed",I5+0)

    You beauty, that works prefectly

    Thanks very much for your help

    Andy

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Using "IF" and todays date

    That means the date in I5 was entered in a cell that was preformatted as Text or it was entered with an preceding apostrophe.

    To fix, you can select the column of dates (if they are in column I) and go to data|Text to columns and just click Finish. Then while still selected go to Format|Cells and select the proper date format from the Number tab.

+ 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