Calculating the average – several variables to consider
Hi there,
I’m trying to figure out how to properly calculate the average total hours worked in this table.

A few things to consider…
1. Some individuals will only have hours entered for week 1. Therefore, if the individual only has hours entered in week 1, the cell beside “average of total hours worked” should only pull the average of week 1.

However, some individuals will have hours entered in both week 1 and week 2. Therefore, the cell beside “average of total hours worked” should pull the average of weeks 1 and 2.

2. As displayed in the screenshots above, not all cells will be filled in. For example, depending on the individual, they may work Sunday, Monday, Tuesday, Wednesday during week 1; whereas some individuals may work Monday, Tuesday, Wednesday, Thursday during week 1 and then work Monday, Tuesday, Wednesday during week 2.
With these conditions in mind, and factoring in the variables, is it possible to create a script that will accurately calculate the average total hours worked?
Thanks!




