+ Reply to Thread
Results 1 to 3 of 3

Extract Time

Hybrid View

  1. #1
    BBert
    Guest

    Extract Time

    This is my time value:
    19:00 - 23:00

    These are my time intervals:
    Time interval A: 18:00 - 22:00
    Time interval B: 22:00 - 00:00

    I want to check if some (or all) hours within the time value occur in
    the time intervals. If yes, then give me those hours. So the result
    should be:

    19:00 - 22:00 (A)
    22:00 - 23:00 (B)

    Another example.

    time value:
    07:00 - 15:30

    Time interval:
    Time interval C: 06:00 - 08:00

    Check if some (or all) hours within the time value occur in the time
    interval. Yes there's one hour overlapping so the result should be:

    07:00 - 08:00 (C)

    Question, is there a formula or a VBA solution wich can do that?
    Please let me know.

    --
    With Kind Regards,
    BBert

    April 20, 1986
    Celtics (135) - Bulls (131)
    Larry Bird: "God disguised as Michael Jordan"

  2. #2
    Kevin B
    Guest

    RE: Extract Time

    Perhaps a custom VB function similar to the following example would work

    Function TimeFrame(TimeValue As Date) As String

    If Hour(TimeValue) = 0 Or Hour(TimeValue) >= 23 And _
    Hour(TimeValue) <= 24 Then
    TimeFrame = "C"
    ElseIf Hour(TimeValue) >= 18 And Hour(TimeValue) < 22 Then
    TimeFrame = "A"
    ElseIf Hour(TimeValue) Next evaluation statement goes here
    TimeFrame = "X"
    End If

    End Function

    --
    Kevin Backmann


    "BBert" wrote:

    > This is my time value:
    > 19:00 - 23:00
    >
    > These are my time intervals:
    > Time interval A: 18:00 - 22:00
    > Time interval B: 22:00 - 00:00
    >
    > I want to check if some (or all) hours within the time value occur in
    > the time intervals. If yes, then give me those hours. So the result
    > should be:
    >
    > 19:00 - 22:00 (A)
    > 22:00 - 23:00 (B)
    >
    > Another example.
    >
    > time value:
    > 07:00 - 15:30
    >
    > Time interval:
    > Time interval C: 06:00 - 08:00
    >
    > Check if some (or all) hours within the time value occur in the time
    > interval. Yes there's one hour overlapping so the result should be:
    >
    > 07:00 - 08:00 (C)
    >
    > Question, is there a formula or a VBA solution wich can do that?
    > Please let me know.
    >
    > --
    > With Kind Regards,
    > BBert
    >
    > April 20, 1986
    > Celtics (135) - Bulls (131)
    > Larry Bird: "God disguised as Michael Jordan"
    >


  3. #3
    bert-is@home.nl
    Guest

    Re: Extract Time

    Thanks Kevin
    I will give that a try, but i'm afraid it's not what i'm looking for. I
    want a specification of the hours.
    time value: 12:00 - 20:00
    time interval: 18:00 - 23:00
    result should show: 18:00 - 20:00

    With Kind Regards,
    BBert

    April 20, 1986
    Celtics (135) - Bulls (131)
    Larry Bird: "God disguised as Michael Jordan"


+ 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