ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Intersect for time (https://www.excelbanter.com/excel-programming/444353-intersect-time.html)

Jorgen Bondesen

Intersect for time
 
Hi NG


I need help.

1 day = 24 h

Start time A1: 8 h
Using time A2: 3 h
Or
Using time A2: 5 h


Break1 start B1: 9
Break1 end B2: 9:15

Break2 start C1: 12
Break2 end C2: 12:3

I want to know when Break1 and/or Break2 are a intersect in time range: 8 to
8+3=11 / 8+5=13

Is there a function like (I know this is for Range):
Set isect = Application.Intersect(Range("rg1"), Range("rg2"))

Both a solution for VBA and formula will be fine, but i prefere VBA

--
Best regards
Joergen Bondesen




Wouter HM

Intersect for time
 
Hello Joergen,

If you use the time format for al the cells you mentioned in your
question you could use a formula:

=IF(AND(A1<B1;A1+A2C2);"Intersect 1 +
2";IF(AND(A1<B1;A1+A2B2);"Intersect
1";IF(AND(A1<C1;A1+A2C2);"Intersect 2";"")))

Thuis is a single formula, remove the linebreaks taht might be
inserted by the newsgroup system.


HTH,

Wouter

Jorgen Bondesen

Intersect for time
 
Hi Wouter

Thanks for reply.

--
Best regards
Jorgen Bondesen


"Wouter HM" skrev i en meddelelse
...
Hello Joergen,

If you use the time format for al the cells you mentioned in your
question you could use a formula:

=IF(AND(A1<B1;A1+A2C2);"Intersect 1 +
2";IF(AND(A1<B1;A1+A2B2);"Intersect
1";IF(AND(A1<C1;A1+A2C2);"Intersect 2";"")))

Thuis is a single formula, remove the linebreaks taht might be
inserted by the newsgroup system.


HTH,

Wouter





All times are GMT +1. The time now is 06:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com