Forum Discussion

sharear's avatar
sharear
Copper Contributor
May 24, 2022
Solved

Formula does not work in my computer

Date..............Day...............Time In............Time Out...........Time In............Time Out...........Total Hours
5/24/2022.....Tuesday.......08:05AM........12:00PM...........07:00PM .......12:01 AM ...........#VALUE!

I used this =(E9-D9)+(H9-G9) Formula. But my computer didn't work. I Go to Region-Additional Date & Time- number-list operator. But didn't work formula.

  • sharear 

    Are you sure you have time formatted in am/pm time format, not texts? In first case here

    it shall be space before PM. You may check applying General format to that cell. If time, you'll see the number ~0.6674

  • sharear 

    Are you sure you have time formatted in am/pm time format, not texts? In first case here

    it shall be space before PM. You may check applying General format to that cell. If time, you'll see the number ~0.6674

  • sharear 

    The time in D9 is PM and that in E9 is AM, so the checkout time is after midnight. This makes the difference E9-D9 negative. Excel cannot handle that.

    Use the following:

     

    =MOD(E9-D9,1)+MOD(H9-G9,1)

     

    Format I9 as h:mm. For Total Hours in I9, you will want to use the custom format [h]:mm to allow for a total over 24 hours,

      • sharear 

        Could you attach a sample workbook (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Thanks in advance.

Resources