+ Reply to Thread
Results 1 to 7 of 7

Calculate Date between Two Different Time Stamps

  1. #1
    Registered User
    Join Date
    06-20-2018
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    3

    Calculate Date between Two Different Time Stamps

    Need help in writing the formula to find the date between two different time period

    Example :
    If the B2 value is between 6/1/18 8:00 AM to 6/2/18 8:00 AM then need C2 to show date at 6/1/18
    similarly if B2 value is between 6/2/18 8:00 AM to 6/3/18 8:00 AM then need C3 to show date as 6/2/18

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Calculate Date between Two Different Time Stamps

    This looks like it's working

    =B2-(MOD(B2,1) < TIME(8,0,0))

    Depends what results you want for other values
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Calculate Date between Two Different Time Stamps

    Try

    =B2-1/3 formatted as date, or
    =INT(B2-1/3) if you don't want the time portion

  4. #4
    Registered User
    Join Date
    06-20-2018
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Calculate Date between Two Different Time Stamps

    So i have the date and time stamps in column C... need the results as in Column B ( i have manually entered it now).. change in date required refer to Row 8

    1 18/06/2018 16/06/2018 16:15
    2 18/06/2018 17/06/2018 16:30
    3 18/06/2018 18/06/2018 16:45
    4 18/06/2018 19/06/2018 17:00
    5 18/06/2018 19/06/2018 17:15
    6 18/06/2018 19/06/2018 17:30
    7 18/06/2018 19/06/2018 17:45
    8 19/06/2018 19/06/2018 18:00
    9 19/06/2018 19/06/2018 18:30
    10 19/06/2018 19/06/2018 18:45
    11 19/06/2018 19/06/2018 19:00
    12 19/06/2018 19/06/2018 19:15
    13 19/06/2018 19/06/2018 19:30
    14 19/06/2018 19/06/2018 19:45

  5. #5
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Calculate Date between Two Different Time Stamps

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  6. #6
    Registered User
    Join Date
    06-20-2018
    Location
    India
    MS-Off Ver
    Office 365
    Posts
    3

    Re: Calculate Date between Two Different Time Stamps

    Thanks Sandy, i have attached the sheet as advised.. Before and After sheet with expected results color coded the cells for easy identification
    Attached Files Attached Files

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Calculate Date between Two Different Time Stamps

    jacobraj1831 I have a question regarding B2 in the upload and post #1:
    If the B2 value is between 6/1/18 8:00 AM to 6/2/18 8:00 AM then need C2 to show date at 6/1/18
    B2:C2 is 5/31/2018 and 6/1/2018 17:30

    The time/date slot C2 is between 6/1/18 8:00 AM and 6/2/18 8:00 AM. So why is B2 5/31/18 and not 6/1/18?

    What am I missing?
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Calculate total hours worked between 2 date/time stamps ignoring weekends and holidays
    By drewship in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-01-2015, 09:59 AM
  2. Replies: 2
    Last Post: 06-13-2014, 10:07 PM
  3. Formula to calculate date and time stamps + lunch
    By excelgeezer in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-02-2013, 05:35 AM
  4. Excel 2007 : Difference between two Date Time Stamps
    By Sedlacek2001 in forum Excel General
    Replies: 3
    Last Post: 05-15-2012, 11:12 AM
  5. Calculate difference between two time stamps...
    By chi11 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-21-2011, 09:31 PM
  6. Time Difference in hours between two date time stamps
    By Cipher in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-17-2010, 10:24 AM
  7. Difference between two Excel Date/Time Stamps
    By lnapier in forum Excel Formulas & Functions
    Replies: 51
    Last Post: 09-06-2005, 12:05 PM

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