Rolling Look-backs In Excel... With Intermittent Zero Value Cells Throughout

cmjay

New Member
Joined
Nov 10, 2013
Messages
10
Hi All,

I've never asked the board for help directly before as I've always been able to find answers in reply to other posters' questions! This time I am truly stumped.

I've got a spreadsheet that lists employee hours worked by week, I'm trying to create a function that would give an automatic look-back of both 90 days and 6 months. I've found some useful answers in other threads, but they tend to hinge on a zero value cell signaling the latest week (not) worked; however, for this purpose, some employees may have zero value fields for some weeks but have worked others.

I'm looking for a formula that can be uniformly applied to all employees in the spreadsheet and average their weekly hours for the past 90 or 180 days without having to update the formula each week new hours are entered.

Any assistance you all could provide would be greatly appreciated!

Thanks,

Chris
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Thanks for the reply!

Does this help? I'm trying to add the average at the end of a long set of data; it will correspond to a row rather than a column.

[TABLE="class: grid, width: 1100"]
<tbody>[TR]
[TD]Last Name[/TD]
[TD]First Name[/TD]
[TD]FT/PT[/TD]
[TD]Notes[/TD]
[TD]Shift[/TD]
[TD="align: right"]5/18/2013[/TD]
[TD="align: right"]5/25/2013[/TD]
[TD="align: right"]6/1/2013[/TD]
[TD="align: right"]6/8/2013[/TD]
[TD="align: right"]6/15/2013[/TD]
[TD="align: right"]6/22/2013[/TD]
[TD="align: right"]6/29/2013[/TD]
[TD="align: right"]7/6/2013[/TD]
[TD="align: right"]7/13/2013[/TD]
[TD="align: right"]7/20/2013[/TD]
[TD="align: right"]7/27/2013[/TD]
[/TR]
[TR]
[TD]Deo[/TD]
[TD]John[/TD]
[TD]FT/PT[/TD]
[TD]None[/TD]
[TD]Nights[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]12.5[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]16[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]15.5[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]15.5[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]20.5[/TD]
[/TR]
</tbody>[/TABLE]

Chris
 
Upvote 0
Here are two possible methods:


Excel 2010
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAF
1Last NameFirst NameFT/PTNotesShift5/18/20135/25/20136/1/20136/8/20136/15/20136/22/20136/29/20137/6/20137/13/20137/20/20137/27/20138/3/20138/10/20138/17/20138/24/20138/31/20139/7/20139/14/20139/21/20139/28/201310/5/201310/12/201310/19/201310/26/201311/2/201311/9/201311/16/2013
2DeoJohnFT/PTNoneNights1212.5310161815.52115.5720.5419191421281887011244301522
Average 90



Excel 2010
AHAIAJ
190180
2With helper15.78571415.296296
3Without Helper15.78571415.296296
Average 90
Cell Formulas
RangeFormula
AI2=SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=AI1),$F$2:$AF$2)/SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=AI1))
AI3=SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=90),$F$2:$AF$2)/SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=90))
AJ2=SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=AJ1),$F$2:$AF$2)/SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=AJ1))
AJ3=SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=180),$F$2:$AF$2)/SUMPRODUCT(--(TODAY()-$F$1:$AF$1<=180))
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top