Time Question

deerxing

New Member
Joined
Mar 18, 2008
Messages
27
Can someone tell me why this formula does not work?

=MAX(MIN(0:00,0:00)-MAX(23:00,21:45),0), the answer I am seeking is 1 hour (from 23:00 to 0:00). This formula works great for all time slots except those ending at midnight (0:00).



Thanks
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Bad logical execution is one reason, to break it down a little

=MAX(MIN(0:00,0:00)-MAX(23:00,21:45),0) equates to

=MAX(0:00-23:00,0)

0:00-23:00 will give a negative value, meaning 0 is the max value, and final result.

Why do you have 4 times in the formula? A non-working formula is meaningless without a description of what you're trying to do.
 
Last edited:
Upvote 0
Can someone tell me why this formula does not work?

=MAX(MIN(0:00,0:00)-MAX(23:00,21:45),0), the answer I am seeking is 1 hour (from 23:00 to 0:00). This formula works great for all time slots except those ending at midnight (0:00).



Thanks
Try this...

Book1
AB
111:00 PM12:00 AM
29:45 PM12:00 AM
Sheet3

=MAX(0,MIN(B1,B2)-MAX(A1,A2)+1)

Format as h:mm
 
Upvote 0
A B
1 21:45 0:00

2 23:00 0:00


Refering to cells 1A & 1B (employee in & out punch for a shift) I need a formula that will give me the amount of time in the shift that fell between cells 2A & 2B.
 
Upvote 0
=IF(B3>=A3,B3-A3,(24-(A3-B3)))


Try this formula to get the time duration :)
NOTE: we have the same table...
 
Last edited:
Upvote 0
Did not render the result I am looking for.

I have a shift start time noted in cell 1A and a shift end time noted in cell 1B and I want to use a formula to apply to all shifts worked to determine how many of the hours in each shift fall between the values in cell 1A & 1B (23:00 (11pm) and 0:00 (12am)), any other ideas?
 
Upvote 0
I use this on my spreadsheet and it works for time ending that is less than time starting.

= ((B1 < A1) + B1 - A1) + ((B2 < A2) + B2 - A2)
 
Last edited:
Upvote 0
I use this on my spreadsheet and it works for time ending that is less than time starting.

=(B1<a1)+b1-a1><a1)+b1-a1>< p>


Post your formula then insert a space after any < signs before clicking the Submit Reply button. The board software interprets the < as an HTML tag.
</a1)+b1-a1></a1)+b1-a1>
 
Upvote 0
Sorry, one of the cell references was wrong in my suggestion, should be

=MAX(MIN(B2+(B2< A2),$B$1+($B$1< $A$1))-MAX(A2,$A$1),0)
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,550
Members
452,927
Latest member
rows and columns

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