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

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
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.

Last NameFirst NameFT/PTNotesShift5/18/20135/25/20136/1/20136/8/20136/15/20136/22/20136/29/20137/6/20137/13/20137/20/20137/27/2013
DeoJohnFT/PTNoneNights1212.5310161815.52115.5720.5

<tbody>
</tbody>

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,216,729
Messages
6,132,384
Members
449,725
Latest member
Enero1

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