0
votes

My manager needs to know when her employees (EE) are reaching overtime. There are 80+ EEs on the job site so it is crucial for her to be able to see what day the EEs reach 40 hours. Once I get the Sequential Sum by employee column figured out I will add on straight time and overtime columns but I need to know what day an EE reaches 40 hours first.

This is what I'd like the spread sheet to look like:

EE No   Hours   Date        Sequential Sum
5001    8       7/27/2015   8
5002    8       7/27/2015   8
5003    10      7/27/2015   10
5004    10      7/27/2015   10
5001    8       7/28/2015   16
5002    8       7/28/2015   16
5003    10      7/28/2015   20
5004    10      7/28/2015   20
5001    7       7/29/2015   23
5002    7       7/29/2015   23
5003    10      7/29/2015   30
5004    10      7/29/2015   30
5001    8       7/30/2005   31
5002    10      7/30/2005   33
5003    10      7/30/2005   40
5004    11      7/30/2005   41
5001    10      7/31/2015   41
5002    10      7/31/2015   43
5003    10      7/31/2015   50

The first 3 columns are keyed in by the manager. I'm looking for a formula that will sum cumulatively by employee in the Sequential Sum column. Notice EE 5001 worked 7 hours on 7/29/15, but the cumulative sum for EE 5001 is 23 because 8 hours were worked on 7/27/15 and 7/28/15 each.

I have tried the following without success:

=SUMIF([EE No],"=[@[EE No]]",[Hours])

{=SUM(IF([@[EE No]]=[EE No],[@Hours]))}

I've experimented with OFFSET, FREQUENCY, MATCH SUMIF and SUMIFS unsuccessfully. Any help you can provide with this formula will be greatly appreciated.

I'm not opposed to a VBA solution either so long as I can get the correct data back in the table.

3

3 Answers

0
votes

I would switch the reference from a table reference to a mix of absolute and relative references. By using an absolute reference for the start of a range and a relative reference for the current row that you are on, you can use the SUMIF equation in Excel

In cell E2, type in the following equation and copy and paste it all the way to the bottom, making sure that you have the $ around the first cell of the range

=SUMIF($A$2:A2,A2,$B$2:B2) 
0
votes

In D2 use this formula based on the SUMIF function.

=sumif(A$2:A2, A2, B$2:B2)

The locked starting row for the criteria and summing ranges will grow as it is filled down.

If you are absolutely determined to use structured table references, introduce the OFFSET function to shape the criteria and summing ranges.

=SUMIF(OFFSET([EE No], 0,0,ROW(1:1), 1), [@[EE No]], OFFSET([Hours], 0,0,ROW(1:1), 1))

OFFSET is considered a volatile function that recalculates whenever anything in the workbook changes.

0
votes

=SUMIF($A:$A, E2,$B:$B )

In this formula $A:$A considers entire A Column and E2 will be the input cell.Provide the EE No for which you want to calculate the sum in E2.Based on the provided input sum of matched values from entire B column($B:$B) will be displayed.

This can work even if data is added in future.