LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Calculate rolling average using last 30 values greater than 0.

I have two columns of data, production in tons and emissions in lbs for each
calendar day, no missing data, but can have values=0 (no production).
What I what to do is calculate a 30-day rolling average of emission
lbs/production tons using the last 30 production values that are greater than
zero.
For simplicity, in example below, assume I am looking for a 5-day rolling
average
A B C D
Date Production Emissions 5-day average
(tons) (lbs) (lb/ton)
1/1/09 10,000 2,000 n/a
1/2/09 5,000 1,000 n/a
1/3/09 5,000 1,000 n/a
1/4/09 5,000 1,000 n/a
1/5/09 5,000 1,000 0.200 (=6,000 lbs/30,000 tons)
1/6/09 8,000 1,000 0.179 (=5,000 lbs/28,000 tons)
1/7/09 0 0 0.179 (=5,000
lbs/28,000 tons)
1/8/09 0 0 0.179 (=5,000
lbs/28,000 tons)
1/8/09 9,000 3,000 0.219 (=7,000 lbs/32,000 tons)

Thanks in advance!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate average with missing values Arne Hegefors Excel Worksheet Functions 2 January 14th 09 10:02 AM
how do i calculate a 4 week rolling average Charliechoo Excel Discussion (Misc queries) 1 October 16th 07 09:14 PM
ignore MAX and MIN values in a set to calculate average Dave F[_2_] Excel Discussion (Misc queries) 5 October 16th 07 06:07 PM
Calculate average and not include zero values k1ngy Excel Discussion (Misc queries) 5 March 6th 07 07:59 PM
How can I create a rolling average between 2 values? tomcat Excel Worksheet Functions 2 January 28th 05 02:49 PM


All times are GMT +1. The time now is 03:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"