Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I extract time only in Excel? | Excel Discussion (Misc queries) | |||
How to extract time and date | Excel Discussion (Misc queries) | |||
extract date between a given time frame | New Users to Excel | |||
How do i extract the total editing time? | Excel Discussion (Misc queries) | |||
extract time from text import | Excel Programming |