Numbers Error about Duration

I need help working on this formula. I transferred this information from an excel spread sheet. My formulas will not work in number. I have attached a screen of the error message about duration. I have attached a second screen shot with the formula that will not work. Can someone help fix this error.



MacBook Air

Posted on Oct 20, 2023 11:47 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 20, 2023 2:08 PM

I recommend formatting columns C-F as text, not date&time, so there will be no date associated with the entries. It is not a requirement, though.


=IFERROR(MOD(DUR2HOURS(D14−C14),24),0)+IFERROR(MOD(DUR2HOURS(F14−E14),24),0)


This works even when the log-out time is earlier than the log-in time, like when logging out after midnight.


This formula does not check that the entries are valid times of day. If a time was not entered in correct format to be interpreted as a time of day, that set of log-in and log-out times will be ignored (no hours worked). If you need those input errors to be flagged, the formula can be rewritten as


=IF(AND(C14≠"",D14≠""),MOD(DUR2HOURS(D14−C14),24),0)+IF(AND(E14≠"",F14≠""),MOD(DUR2HOURS(F14−E14),24),0)


The formula result will be an error if the inputs are not all times of day.





1 reply
Question marked as Top-ranking reply

Oct 20, 2023 2:08 PM in response to JasonPVM

I recommend formatting columns C-F as text, not date&time, so there will be no date associated with the entries. It is not a requirement, though.


=IFERROR(MOD(DUR2HOURS(D14−C14),24),0)+IFERROR(MOD(DUR2HOURS(F14−E14),24),0)


This works even when the log-out time is earlier than the log-in time, like when logging out after midnight.


This formula does not check that the entries are valid times of day. If a time was not entered in correct format to be interpreted as a time of day, that set of log-in and log-out times will be ignored (no hours worked). If you need those input errors to be flagged, the formula can be rewritten as


=IF(AND(C14≠"",D14≠""),MOD(DUR2HOURS(D14−C14),24),0)+IF(AND(E14≠"",F14≠""),MOD(DUR2HOURS(F14−E14),24),0)


The formula result will be an error if the inputs are not all times of day.





This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Numbers Error about Duration

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.