Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
tomcat
 
Posts: n/a
Default How can I create a rolling average between 2 values?

Hi,

I have an excel spreadsheet and need to create average times in between a
start time and finish time within a single column. For instance, if A1
contains 10:00 & A10 contains 12:00 cells A2:A9 should contain a rolling
average between them so A2=10:12, A3=10:24 and so on to create a staggered
set of times. The number of cells in between the start and end times has to
be variable and it ideally needs to be able to deal with situations where the
start & finish times go accross midnight. The times need to be formatted
American style with hours & minutes (10am as 10:00).

Many thanks
  #2   Report Post  
Art
 
Posts: n/a
Default

Try the following:

Use this formula:
=$A$1+(ROW(A2)-ROW($A$1))*($A$10-$A$1)/ROWS($A$1:$A$10)

For the crossing midnight problem, the easiest solution I can think of is:
Format the cells as just a time (perhaps with AM and PM). However, enter
the times as full dates, such as 1/1/05 2:00 PM and 1/2/05 1:00 AM. These
should show up fine, but will use the date to account for crossing midnight.

Art

"tomcat" wrote:

Hi,

I have an excel spreadsheet and need to create average times in between a
start time and finish time within a single column. For instance, if A1
contains 10:00 & A10 contains 12:00 cells A2:A9 should contain a rolling
average between them so A2=10:12, A3=10:24 and so on to create a staggered
set of times. The number of cells in between the start and end times has to
be variable and it ideally needs to be able to deal with situations where the
start & finish times go accross midnight. The times need to be formatted
American style with hours & minutes (10am as 10:00).

Many thanks

  #3   Report Post  
tomcat
 
Posts: n/a
Default

Many thanks Art - elegant and accurate solution!

"Art" wrote:

Try the following:

Use this formula:
=$A$1+(ROW(A2)-ROW($A$1))*($A$10-$A$1)/ROWS($A$1:$A$10)

For the crossing midnight problem, the easiest solution I can think of is:
Format the cells as just a time (perhaps with AM and PM). However, enter
the times as full dates, such as 1/1/05 2:00 PM and 1/2/05 1:00 AM. These
should show up fine, but will use the date to account for crossing midnight.

Art

"tomcat" wrote:

Hi,

I have an excel spreadsheet and need to create average times in between a
start time and finish time within a single column. For instance, if A1
contains 10:00 & A10 contains 12:00 cells A2:A9 should contain a rolling
average between them so A2=10:12, A3=10:24 and so on to create a staggered
set of times. The number of cells in between the start and end times has to
be variable and it ideally needs to be able to deal with situations where the
start & finish times go accross midnight. The times need to be formatted
American style with hours & minutes (10am as 10:00).

Many thanks

Reply
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
How do I create a formula to calculate the average percentage rat LD Excel Worksheet Functions 5 January 13th 05 06:17 PM
Can you average data in 1 column based on a range of values in another? kman24 Excel Worksheet Functions 2 November 17th 04 02:09 PM
How do i create a "look up" to sum values in excel? tbaldwin Excel Worksheet Functions 1 November 10th 04 05:17 PM
Calculating Average Values Using Arithmetic Equations ryangruhn Excel Worksheet Functions 0 November 3rd 04 07:42 PM
Calculating Average Values Using Arithmetic Equations ryangruhn Excel Worksheet Functions 2 November 3rd 04 07:22 PM


All times are GMT +1. The time now is 06:14 AM.

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

About Us

"It's about Microsoft Excel"