+ Reply to Thread
Results 1 to 7 of 7

Date and time stamp between two date and timestamps

  1. #1
    Registered User
    Join Date
    06-03-2019
    Location
    sydney
    MS-Off Ver
    2016
    Posts
    3

    Date and time stamp between two date and timestamps

    Hi,

    first post in the forum, im needing a formula to check that a date and time stamp is between a certain date and time range

    B1 = priority (value from 1 to 4) using value 1 in this example
    C1 = Start date and time
    G1 = End date and time
    H1 = duration between C1 and G1
    L1 requires a formula to check if the start date and time C1 is between 8:00 am and 6:00 pm on that day if yes check the duration is no more than 15 mins, or show blank cell
    M1 requires a formula to check if the start date and time C1 is before 8:00 am and greater than 6:00 pm on that day if yes check the duration is no more than 30 mins, or show blank cell

    im have variable data in the sheet of records so the formula will be dragged down to fit the data.
    I have tried to extract the date and portion and concatenate the time stamp to get a variable to check the start time against but with no luck.

    hope someone can give me a bit of help thanks.

    Normally if this was value I can write an If statement but using the date portion of the start point and adding a time stamp is stopping me completing the task.
    Attached Files Attached Files
    Last edited by SLA_MANAGER; 06-28-2019 at 01:29 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Date and time stamp between two date and timestamps

    Welcome to the forum!

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    06-03-2019
    Location
    sydney
    MS-Off Ver
    2016
    Posts
    3

    Re: Date and time stamp between two date and timestamps

    Thanks I have attached a file

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Date and time stamp between two date and timestamps

    Please see point 2 of my instructions, add what has been requested and post the file again.

  5. #5
    Registered User
    Join Date
    06-03-2019
    Location
    sydney
    MS-Off Ver
    2016
    Posts
    3

    Re: Date and time stamp between two date and timestamps

    new version of the file with point 2 shown as an example

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Date and time stamp between two date and timestamps

    There is still no mocked up data in columns L or M. Try again, please.

  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: Date and time stamp between two date and timestamps

    Not sure I am grasping the concept, though try this.

    With the priority number typed into N1 these formulas in L2 and M2 and format same as column H
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Priority 1

    L
    M
    N
    1
    1
    between
    8:00 am to 6:00 pm
    1
    before
    8:00 am after 6:00 pm
    1
    2
    31:30
    00:00


    Priority 2

    L
    M
    N
    1
    1
    between
    8:00 am to 6:00 pm
    1
    before
    8:00 am after 6:00 pm
    2
    2
    00:00
    140:34


    Priority 3

    L
    M
    N
    1
    1
    between
    8:00 am to 6:00 pm
    1
    before
    8:00 am after 6:00 pm
    3
    2
    220:27
    274:44


    Priority 4

    L
    M
    N
    1
    1
    between
    8:00 am to 6:00 pm
    1
    before
    8:00 am after 6:00 pm
    4
    2
    1666:58
    00:00
    Last edited by FlameRetired; 06-28-2019 at 02:24 PM.
    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] Convert Unix Date-time stamp to excel date and/or time columns
    By judikz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2015, 05:46 PM
  2. Need vba code to change date&time stamp as date format dd-mmm-yy in A:A rng
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2014, 06:08 AM
  3. [SOLVED] Date/Time stamp:inserting the source book date & time into the destination book
    By macrorookie in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-24-2014, 06:48 PM
  4. Need to capture date data in a text string containing a date and time stamp
    By Grilleman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-07-2013, 01:14 PM
  5. [SOLVED] Date time stamp to date conversion
    By N8237 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2012, 11:25 AM
  6. [SOLVED] Extract a time from a cell with date and time stamp and then perform calculations
    By Marcos Aristotelous in forum Excel General
    Replies: 3
    Last Post: 10-31-2012, 04:36 AM
  7. Separating date from a Date & Time stamp
    By JT in forum Excel General
    Replies: 3
    Last Post: 02-20-2005, 01:06 PM

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