0

I have a work schedule table with start time, end time, daily total:

The Daily Total function is as follows:

=IF(AND(WEEKDAY(A6,15)=6,WEEKDAY(A6,15)=7),"",IF(OR(B6="Sick",C6="Sick"),"8:00",C6-B6))

Basically what it says is:

  1. If it's weekend don't place anything in the daily total cell.
  2. If Start Time or End Time says Sick place 8:00 in the daily total cell.
  3. Otherwise, calculate the time difference and place it in the Daily Total cell.

I assume that by now you know that I am making a simple working schedule excel spreadsheet with multiple conditions. So, the problem is that Excel cannot sum the Daily Total correct because of the function I had created for the Daily Total field.

Problem illustration:

If you have these hours inserted manually:

7:18
8:00

Then you sum them up you get 15:18. So far so good...

If you use my function to get these numbers and you try to sum them up you get 7:18, why is that? I reckon it has something to do with my function rather than some Excel settings but I could be wrong.

Thanks for the help.

1 Answer 1

3

Your function is entering text into the cell, which the SUM function will ignore. Use this instead:

=IF(AND(WEEKDAY(A6,15)=6,WEEKDAY(A6,15)=7),"",IF(OR(B6="Sick",C6="Sick"),TIME(8,0,0),C6-B6))
Sign up to request clarification or add additional context in comments.

4 Comments

That never crossed my mind, thank you very much Rory.
Actually, now that I have updated my function accordingly I still don't get the desired resul. Could you possibly look at my table?
I honestly have no idea, I don't get the desired result when I'm trying this function on my entire table, when I try it in a different sheet with a few days the SUM is working just fine.
If it's just the display that's the issue, change the cell format for I4 to [h]:mm rather than h:mm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.