Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,316
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I extract time only in Excel? grant Excel Discussion (Misc queries) 9 June 26th 08 08:26 AM
How to extract time and date Hemanth Excel Discussion (Misc queries) 2 June 27th 07 03:00 PM
extract date between a given time frame B New Users to Excel 1 April 3rd 07 09:18 PM
How do i extract the total editing time? Charles Paquette Excel Discussion (Misc queries) 5 August 12th 06 11:32 PM
extract time from text import HmxPete Excel Programming 5 August 18th 05 10:41 PM


All times are GMT +1. The time now is 02:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"