+ Reply to Thread
Results 1 to 11 of 11

DateDiff

  1. #1
    Registered User
    Join Date
    12-31-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    23

    DateDiff

    I have a spreadsheet that has value in it like this

    6/23/2008 11:54
    I want to verify if it's 3 month or more then the current date from now

    I can't seem to find the proper VBA code for it ..

    any help ?

    Thanks

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: DateDiff help.

    Try this

    =IF(A1>DATE(YEAR(TODAY()),MONTH(TODAY())+3,DAY(TODAY())),"over","Under")

  3. #3
    Registered User
    Join Date
    12-31-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: DateDiff

    It's telling me Under and that doesn't seem to work.

    Since it's OVER 3 month from now .. !

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: DateDiff

    June 2008 was a while ago.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    12-31-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: DateDiff

    Maybe i don't understand it correctly ,

    If it's over 3 month shouldn't it say "Over" ?

    Like it's been more then 3 month right ?

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: DateDiff

    Three months from now is in the future not in the past.

  7. #7
    Registered User
    Join Date
    12-31-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: DateDiff

    Ok so what i want is to now it's it's been more then 3 month since the date value that i gave ..

    6/23/2008 11:54
    Like since June 2008 to Today , it's been more then 3 month , that's what i need.

    Thanks guys !

  8. #8
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: DateDiff

    Try This

    =IF(A1<DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())),"over","Under")

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,697

    Re: DateDiff

    You can use DATEDIF like this

    =IF(DATEDIF(A1,TODAY()+1,"m")>=3,"Over","Under")

  10. #10
    Registered User
    Join Date
    12-31-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    23

    Re: DateDiff

    Quote Originally Posted by davesexcel View Post
    Try This

    =IF(A1<DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())),"over","Under")

    That works ..


    Now if i have a full columns of this and i want to verify every cells of this column and add on the next cell "Over" Or "Under"

    how would that be in VBA scripting ?

    thanks

  11. #11
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: DateDiff

    VBA is not required, enter Dadylonglegs formula in the first cell, then doubleclick on the fill handle to get the formula down to the last cell.,

    If you want this done in VBA, then attach a sample workbook

+ 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