+ Reply to Thread
Results 1 to 3 of 3

Date formatted as general makes false statement

  1. #1
    Forum Contributor
    Join Date
    11-03-2004
    Posts
    139

    Date formatted as general makes false statement

    I have inherited a large project that is causing me a problem with the new year causing the false statements in if statements. Thank you in advance for your expert knowledge. I am using excel 2003 and these formulas are written for numbers when in reality the number represents dates. so the formulas are correct but wrong if you are using them as a date.

    Column A has 123110 meaning (12/31/2010)
    Column B has 10311 meaning (1/3/2011)
    Column C has =IF(f2>0,f2,g2)
    Column D has =IF(c2>b2,"L",IF(c2<a2,"E"))
    Column F & G both have 123110 meaning (12/31/2010)

    The result in column D is L which is correct if reading as numbers but as dates it should result in an E.

    I have attached a sample.
    Thank you
    Michelle
    Attached Files Attached Files
    Last edited by leem; 01-05-2011 at 08:01 PM.

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

    Re: Date formatted as general makes false statement

    C2 is equal to A2, so the formula won't give "E" as it is asked to give "E" if it is less than, not less than or equal to.

    Also, you need to convert the numbers to actual dates that Excel understands...

    Try:

    =IF(TEXT(C2,"00-00-00")+0>TEXT(B2,"00-00-00")+0,"L",IF(TEXT(C2,"00-00-00")+0<=TEXT(A2,"00-00-00")+0,"E",""))

    And change other references to dates in the formulas to similarly.
    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
    Forum Contributor
    Join Date
    11-03-2004
    Posts
    139

    Re: Date formatted as general makes false statement

    Perfect! Thank you so much.
    Michelle

+ 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