+ Reply to Thread
Results 1 to 4 of 4

Ignoring Time in a Date Time Calculation

Hybrid View

  1. #1
    nmp
    Guest

    Ignoring Time in a Date Time Calculation

    I am being provided data with a date/time stamp where I want to calculate if
    there is a difference between two dates, but ignore the time. Example: in
    cell A2 I have 11/22/2005 0:00 and in cell B2 I have 11/22/2005 12:00 and my
    current formula is IF(B2>A2,1,0) and it is giving me a result of 1. I want
    the formula to ignore the time and give me a result of 0 because the dates
    are the same. I already tried just reformating A2 and B2, but that did not
    work. The time data is still there in the background.

    Thanks!

  2. #2
    Nick Hodge
    Guest

    Re: Ignoring Time in a Date Time Calculation

    Try

    =DATEDIF(A1,A2,"d")

    You can find help for this at

    www.cpearson.com/excel/datedif.htm

    --
    HTH
    Nick Hodge
    Microsoft MVP - Excel
    Southampton, England
    www.nickhodge.co.uk
    nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS


    "nmp" <nmp@discussions.microsoft.com> wrote in message
    news:0BDA3861-3E01-477A-BF2F-F234ABCF32C6@microsoft.com...
    >I am being provided data with a date/time stamp where I want to calculate
    >if
    > there is a difference between two dates, but ignore the time. Example: in
    > cell A2 I have 11/22/2005 0:00 and in cell B2 I have 11/22/2005 12:00 and
    > my
    > current formula is IF(B2>A2,1,0) and it is giving me a result of 1. I
    > want
    > the formula to ignore the time and give me a result of 0 because the dates
    > are the same. I already tried just reformating A2 and B2, but that did
    > not
    > work. The time data is still there in the background.
    >
    > Thanks!




  3. #3
    Peo Sjoblom
    Guest

    Re: Ignoring Time in a Date Time Calculation

    You can use

    IF(INT(B2)>INT(A2),1,0)

    --

    Regards,

    Peo Sjoblom

    "nmp" <nmp@discussions.microsoft.com> wrote in message
    news:0BDA3861-3E01-477A-BF2F-F234ABCF32C6@microsoft.com...
    > I am being provided data with a date/time stamp where I want to calculate

    if
    > there is a difference between two dates, but ignore the time. Example: in
    > cell A2 I have 11/22/2005 0:00 and in cell B2 I have 11/22/2005 12:00 and

    my
    > current formula is IF(B2>A2,1,0) and it is giving me a result of 1. I

    want
    > the formula to ignore the time and give me a result of 0 because the dates
    > are the same. I already tried just reformating A2 and B2, but that did

    not
    > work. The time data is still there in the background.
    >
    > Thanks!




  4. #4
    nmp
    Guest

    Re: Ignoring Time in a Date Time Calculation

    Thanks Peo! That worked!

    "Peo Sjoblom" wrote:

    > You can use
    >
    > IF(INT(B2)>INT(A2),1,0)
    >
    > --
    >
    > Regards,
    >
    > Peo Sjoblom
    >
    > "nmp" <nmp@discussions.microsoft.com> wrote in message
    > news:0BDA3861-3E01-477A-BF2F-F234ABCF32C6@microsoft.com...
    > > I am being provided data with a date/time stamp where I want to calculate

    > if
    > > there is a difference between two dates, but ignore the time. Example: in
    > > cell A2 I have 11/22/2005 0:00 and in cell B2 I have 11/22/2005 12:00 and

    > my
    > > current formula is IF(B2>A2,1,0) and it is giving me a result of 1. I

    > want
    > > the formula to ignore the time and give me a result of 0 because the dates
    > > are the same. I already tried just reformating A2 and B2, but that did

    > not
    > > work. The time data is still there in the background.
    > >
    > > Thanks!

    >
    >
    >


+ 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