|
发表于 2014-8-25 10:25:22
|
显示全部楼层
sorry i got no Chinese input and no excel with me at the moment, here is my thought:
add an extra row 'threshold' above your first row, input integer threshold 0-6 for Mon-Sun
for argument sake let's say 'threshold' row is in 'row 2', your 'days' column is in 'column D', your first person's Monday cell is 'E4'
In E4 input formula =if($D4-E$2>1,$D4,if($D4-E$2>0,($D4-E$2)*$D4,0))
drag it across and down
Basically the 'days' is above the threshold, it covered that day/part of the day; if below threshold, it hasn't covered yet therefore it's 0 hrs.
However your whole idea of using 'days' column as a control is rather restricted as it assumed the data is always continuous. If a person was sick on Wednesday, or worked half day on both saturday and sunday, the formula won't pick it up, though it met your requirement.
|
|