+ Reply to Thread
Results 1 to 8 of 8

Date function that compare 2 date in single column and return value

Hybrid View

  1. #1
    Registered User
    Join Date
    05-27-2012
    Location
    langkawi
    MS-Off Ver
    2007
    Posts
    46

    Date function that compare 2 date in single column and return value

    Hi

    How to write simple date function that will compare 2 date in single column and then will return statement "write off" or "still use" if it meet the condition

    example

    Column A Column B
    12/07/2005 Write Off
    12/07/2012 still use



    from example if in date column a is more than the today date, it will automatic show in column B write off else if less than today it will show still in use. This date comparison is to check if the date at column A is more than 2 years or less. This is for inventory system that see if the item is more than or reach 2 years, it will show write off or if less than 2 years, it will show still use


    thanks
    abu
    Last edited by alimamak; 07-19-2012 at 11:06 PM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date function that compare 2 date in single column and return value

    HI Abu,

    Use below formula in Column B and drag down :-

    Formula: copy to clipboard
    =IF(TODAY()-A1>=730,"Write Off", "Still Use")


    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    05-27-2012
    Location
    langkawi
    MS-Off Ver
    2007
    Posts
    46

    Re: Date function that compare 2 date in single column and return value

    thanks dili, that script can be use plus or minus?
    i never though it can be like that

    it now works

    thanks again

    abu

  4. #4
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date function that compare 2 date in single column and return value

    You are welcome Abu

    For plus or minus, you can interchange the position of Today and A1 ... cheers


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  5. #5
    Registered User
    Join Date
    05-27-2012
    Location
    langkawi
    MS-Off Ver
    2007
    Posts
    46

    Re: Date function that compare 2 date in single column and return value

    what value 730 use for? 2 years in days?

  6. #6
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date function that compare 2 date in single column and return value

    Yes.. it is 365 x 2= 730.

    You can further customize this number as per your criteria

    Regards,
    DILIPandey


    <click on below 'star' if this helps>

  7. #7
    Registered User
    Join Date
    05-27-2012
    Location
    langkawi
    MS-Off Ver
    2007
    Posts
    46

    Re: Date function that compare 2 date in single column and return value

    ok dili, thanks again

    abu

  8. #8
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Date function that compare 2 date in single column and return value

    you are welcome abu... cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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