+ Reply to Thread
Results 1 to 8 of 8

Function that compares dates and returns TRUE or FALSE

  1. #1
    Emily
    Guest

    Function that compares dates and returns TRUE or FALSE

    Hi,

    I'll need to come up with a function that compares each value in column
    D with '12/31/2005 ' and return TRUE if the value in column D is
    smaller than '12/31/2005 ', but FALSE if it is greater than '12/31/2005
    '.

    I have the following formula:

    =(D1<'12/31/2005')

    But this gives me an error.

    Also I'l need to know how to apply this formula to other rows. Thanks!

    -Emily


  2. #2

    Re: Function that compares dates and returns TRUE or FALSE

    Hi Emily,

    Please copy and paste the follow in cell E1

    =IF(D1<38717,"True","False")

    After this is done, please copy cell E1 and paste in column E
    throughout.

    P.S: 38717 is the value corresponding to '12/31/2005 '

    Thanks,
    Yash

    Emily wrote:
    > Hi,
    >
    > I'll need to come up with a function that compares each value in column
    > D with '12/31/2005 ' and return TRUE if the value in column D is
    > smaller than '12/31/2005 ', but FALSE if it is greater than '12/31/2005
    > '.
    >
    > I have the following formula:
    >
    > =(D1<'12/31/2005')
    >
    > But this gives me an error.
    >
    > Also I'l need to know how to apply this formula to other rows. Thanks!
    >
    > -Emily



  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    or

    =IF(DATE(2005,12,31)>D5,TRUE,FALSE)

  4. #4
    Jake Marx
    Guest

    Re: Function that compares dates and returns TRUE or FALSE

    Hi Emily,

    [email protected] wrote:
    > Please copy and paste the follow in cell E1
    >
    > =IF(D1<38717,"True","False")
    >
    > After this is done, please copy cell E1 and paste in column E
    > throughout.
    >
    > P.S: 38717 is the value corresponding to '12/31/2005 '


    Alternatively, you can use the DATE function to get the value for 12/31/2005
    (more readable):

    =IF(D1 < DATE(2005, 12, 31), True, False)

    --
    Regards,

    Jake Marx
    www.longhead.com


    [please keep replies in the newsgroup - email address unmonitored]



  5. #5
    Emily
    Guest

    Re: Function that compares dates and returns TRUE or FALSE

    Hi Yash, Jake,

    Thanks for your advice! It works.

    Now I've got all of the TRUE's and FALSE's, and I'll need to sort the
    rows by this value. Howver, when I double-click on the header, nothing
    happened. Any advice on how to sort?

    -Emily


  6. #6
    Emily
    Guest

    Re: Function that compares dates and returns TRUE or FALSE

    Thanks all for the help! It works!

    Now I have another question about sorting the rows by this TRUE or
    FALSE value.
    FYI, I'll start a new topic.

    -Emily


  7. #7
    Dave Peterson
    Guest

    Re: Function that compares dates and returns TRUE or FALSE

    One more:
    =d1<date(2005,12,31)

    It'll return true or false (you don't need the =if() stuff.

    or maybe...

    =year(d1)<2005


    Emily wrote:
    >
    > Hi,
    >
    > I'll need to come up with a function that compares each value in column
    > D with '12/31/2005 ' and return TRUE if the value in column D is
    > smaller than '12/31/2005 ', but FALSE if it is greater than '12/31/2005
    > '.
    >
    > I have the following formula:
    >
    > =(D1<'12/31/2005')
    >
    > But this gives me an error.
    >
    > Also I'l need to know how to apply this formula to other rows. Thanks!
    >
    > -Emily


    --

    Dave Peterson

  8. #8
    Dave Peterson
    Guest

    Re: Function that compares dates and returns TRUE or FALSE

    Double clicking on the header doesn't usually sort by that column.

    Select the whole range and do Data|sort.

    Emily wrote:
    >
    > Hi Yash, Jake,
    >
    > Thanks for your advice! It works.
    >
    > Now I've got all of the TRUE's and FALSE's, and I'll need to sort the
    > rows by this value. Howver, when I double-click on the header, nothing
    > happened. Any advice on how to sort?
    >
    > -Emily


    --

    Dave Peterson

+ 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