+ Reply to Thread
Results 1 to 4 of 4

IF Function using dates

  1. #1
    Registered User
    Join Date
    05-19-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    IF Function using dates

    Hi,
    I am trouble getting the right results using the IF function with dates. I would like the If function to compare 2 dates (some in different years) and if one date 5/30/2011 is before the second date 3/31/2012 then yes value should be zero and if it is not then I would like it to calculate an amount. But the outcome is always showing the calculation and never a zero regardless of dates.
    Can you please help,
    Thank You,
    I am attaching a sample of what I am trying to do.
    =IF(D6<J3,0,F6*J4/36*3)
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: IF Function using dates

    I note that your dates are presented differently. You have 5/30/2011 and 31/3/12. The implication is that one of those dates is not being interpreted correctly as a date. Given your location, I'm guessing that the 2011 date really is a date and the 12 date is actually text that looks a bit like a date.

    I'm answering this on an iPad so I can't really test the theory ... but I'm prepared to put money on it.

    Make sure the 2012 "date" really is a date.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-19-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: IF Function using dates

    Thank You, it works now. You were right, the dates were being presented different.

    I went to both cells with dates and made sure the dates were formatted the same way.. One had 5/30/2011 type format (showing the year with 4 digits) and the other had 3/31/12 (showing the year with 2 digits).

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,086

    Re: IF Function using dates

    You're welcome. Thanks for the rep.

+ 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