So here's the deal... I need to calculate the total number of overtime hours to date. I've searched the threads but have come up short with what I need to accomplish.

My spreadsheet has a TOTAL OVERTIME cell (A5). Cells B5 through BA5 represent the 52 weeks in a year. Each time a value is entered in any of those cells, I would like the TOTAL OVERTIME value to update (overtime is anything over 40 hours). So if 41 is entered in B5, the total overtime to date would be 1. If 44 is entered in C5, the total overtime to date would be 5 hours (1 hour from the previous week and 4 hours from this week).

This is the formula I found, but this only does one 40 hour period. I need something a little more complex.

=IF(A5>=40,SUM(A5-40),"0")

Thanks in advance!

Matt W