+ Reply to Thread
Results 1 to 5 of 5

Help With IF Statment Formula

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Help With IF Statment Formula

    Hi

    I'm working on spreadsheet that in the most basic understanding, compares a date and time that something has been requested with the date and time that the request was fulfilled. The total time in hours is measured to show how long it takes on average to complete the request.

    Dates and times are stored in the mm/dd/yy hh:mm format so that both day and the time of day are stored in the same cell and the time to completion can be measured up to minute.

    What I am looking for is a way to compare two time stamps to make and if statement (or use another formula) that will compare if the days are the same in both time stamps while disregarding the time of day. Basically I would like a formula to give the result of “1” when two time stamps have the same dates and “0” when the dates are different.

    Example:

    A)
    Time Stamp 1
    7/17/12 1:58 PM
    TIme Stamp 2
    7/17/12 8:53 PM
    Result
    =1

    B)
    Time Stamp 1
    7/17/12 1:58 PM
    TIme Stamp 2
    7/20/12 8:53 PM
    Result
    =0


    Notice that in example A the dates are the same (but the times are different) so 1 would be the result. While example B the dates are completely different so a 0 is the result. The trouble I a having is ignoring the hh:mm portion of the time stamp (which is necessary in other calculations) to determine if the request came in on the same day that it was fulfilled.

    Is there a formula that can do this?

  2. #2
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Help With IF Statment Formula

    Try this:

    Please Login or Register  to view this content.
    Docendo discimus.

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help With IF Statment Formula

    That works. Thanks for the help!

  4. #4
    Registered User
    Join Date
    08-07-2012
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Help With IF Statment Formula

    Is there a way to modify this formula to return a "1" if one of the time stamps occured after a date and return a "0" for any other circumstance (if the dates are the same or prior to).

    Example Situation:

    Time Stamp 1
    7/17/12 1:58 PM
    TIme Stamp 2
    7/19/12 8:53 PM
    Result
    =1

  5. #5
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Help With IF Statment Formula

    Just exchange the zero and the one in the formula.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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