I have a spreadsheet the successfully adds two times together, but that has one problem. I am adding two times to get a resulting time elapsed as in this sheet:
The formula I’m using (in column F) to calculate is:
=IF(OR(D4=0,E4=0),0,IF((E4>D4),(E4-D4),((E4+24)-D4))
(I then use =HOUR(F4)+(MINUTE(F4)/60) in column G to convert to a number I can use in other calculations)
The cell format I have been using for all three cells is category - Time: 6:00 PM
My problem… arises when, as in row 8, a value of 12 am is entered. In this case, the value in the formula bar will show 12:00:00 AM, but the cell will display as blank (I assume because zero values are set not to display) and column F will not calculate and will be blank also. Any other time but midnight works without a problem.
In order to remedy this, I have tried different number formats such as [h]:mm, but still nothing works.
Can anyone please tell me how I can enter a time of midnight / 12:00:00 AM and have it be calculated as 12, and not zero? Note: I would prefer to have times formatted as 12hr and not 24 hr.
- - , .
برچسب:
نویسنده: استخدام کار