"Challenge" Time Calculation

lekmx

New Member
Joined
Jun 6, 2017
Messages
9
[FONT=&quot]Dear Masters,[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]I have a real challenge to you, I need formula or VBA that calculate the column [FONT=&quot]10 PM to 5 AM[/FONT] and[FONT=&quot]10 PM to End[/FONT].[/FONT]
[FONT=&quot]
[/FONT]

[FONT=&quot]The formula or VBA need to understand:[/FONT]
[FONT=&quot]
[/FONT]


  • Column “[FONT=&quot]10 PM to 5 AM[/FONT]” Calculate just time between 10 PM until 5 AM (number in hours, can be hours and minutes)
  • Column “[FONT=&quot]10 PM to End[/FONT]” Calculate just time between 10 PM until end (number in hours, can be hours and minutes)
  • In “A4” start 10/09/10 (10 PM) and stop 11/09/2010 (2 AM)
[FONT=&quot]
[FONT=&quot]DAY[/FONT]​


[FONT=&quot]IN[/FONT]​
[FONT=&quot]OUT[/FONT]​


[FONT=&quot]IN[/FONT]​
[FONT=&quot]OUT[/FONT]​


[FONT=&quot]IN[/FONT]​
[FONT=&quot]OUT[/FONT]​


[FONT=&quot]10 PM to 5 AM[/FONT][FONT=&quot][/FONT]
[FONT=&quot]10 PM to End[/FONT]
[FONT=&quot]9/9/10[/FONT]​
[FONT=&quot]6:00 AM[/FONT]​
[FONT=&quot]1:00 PM[/FONT]​


[FONT=&quot]2:00 PM[/FONT]​
[FONT=&quot]6:00 PM[/FONT]​


[FONT=&quot]7:00 PM[/FONT]​
[FONT=&quot]11:30 PM[/FONT]​


[FONT=&quot]1.50[/FONT]
[FONT=&quot]1.50[/FONT]
[FONT=&quot]9/10/10[/FONT]
[FONT=&quot]10:00 PM[/FONT]
[FONT=&quot]2:00 AM[/FONT]














[FONT=&quot]4.00[/FONT]
[FONT=&quot]4.00[/FONT]
[FONT=&quot]9/11/10[/FONT]
[FONT=&quot]10:30 PM[/FONT]
[FONT=&quot]6:00 AM[/FONT]














[FONT=&quot]6.50[/FONT]
[FONT=&quot]7.50[/FONT]
[FONT=&quot]9/12/10[/FONT]
[FONT=&quot]8:00 PM[/FONT]
[FONT=&quot]5:30 AM[/FONT]














[FONT=&quot]7.00[/FONT]
[FONT=&quot]7.50[/FONT]​
[FONT=&quot]9/13/10[/FONT]​
[FONT=&quot]5:00 AM[/FONT]​
[FONT=&quot]10:00 AM[/FONT]​


[FONT=&quot]11:00 AM[/FONT]​
[FONT=&quot]10:00 PM[/FONT]​








[FONT=&quot]0.00[/FONT]​
[FONT=&quot]0.00[/FONT]​
[FONT=&quot]9/14/10[/FONT]​
[FONT=&quot]3:00 AM[/FONT]​
[FONT=&quot]12:00 PM[/FONT]​


[FONT=&quot]1:00 PM[/FONT]​
[FONT=&quot]12:15 AM[/FONT]​








[FONT=&quot]4.25[/FONT]​
[FONT=&quot]4.25[/FONT]​
[FONT=&quot]9/15/10[/FONT]​
[FONT=&quot]12:25 AM[/FONT]​
[FONT=&quot]2:00 AM[/FONT]​


[FONT=&quot]4:00 AM[/FONT]​
[FONT=&quot]8:00 AM[/FONT]​








[FONT=&quot]2.58[/FONT]​
[FONT=&quot]5.58[/FONT]​
[FONT=&quot]9/16/10[/FONT]​
[FONT=&quot]5:00 PM[/FONT]​
[FONT=&quot]10:00 PM[/FONT]​


[FONT=&quot]11:00 PM[/FONT]​
[FONT=&quot]12:30 AM[/FONT]​








[FONT=&quot]1.50[/FONT]​
[FONT=&quot]1.50[/FONT]​
[FONT=&quot]9/17/10[/FONT]​
[FONT=&quot]10:00 PM[/FONT]​
[FONT=&quot]11:00 PM[/FONT]​


[FONT=&quot]12:00 AM[/FONT]​
[FONT=&quot]4:00 AM[/FONT]​


[FONT=&quot]5:00 AM[/FONT]​
[FONT=&quot]10:00 AM[/FONT]​


[FONT=&quot]5.00[/FONT]​
[FONT=&quot]10.00[/FONT]​
[FONT=&quot]9/18/10[/FONT]​
[FONT=&quot]10:00 PM[/FONT]​
[FONT=&quot]1:17 AM[/FONT]​


[FONT=&quot]1:43 AM[/FONT]​
[FONT=&quot]6:00 AM[/FONT]​








[FONT=&quot]6.57[/FONT]​
[FONT=&quot]7.57[/FONT]​

<tbody> [TD="colspan: 8"]
[FONT=&quot]WORK HOURS[/FONT]​
[/TD]

[TD="colspan: 2"]
[FONT=&quot]TIME IN HOURS[/FONT]​
[/TD]
</tbody>
[/FONT]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hi, your request is almost certainly achievable, but it's not clear to me at all, what exactly you want to do.

What does your input data look like, exactly ?

What are the results that you want, exactly ?

Please try to explain really clearly what you want to do.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top