Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Last 3 rounds Average

I need to automate a rolling 3-round average for the golf league. The
scenario is like this: We play 20 weeks. Some folks miss a week or two
so we need a current week average of our last three rounds. I can
certainly figure the last three "weeks" out, but if they're blank, I
need to go back to the last round. Using our first 7 weeks, here's
what I'm trying to accomplish:

Week 1 2 3 4 5 6 7 Overall - Last 3
Jeff 88 87 93 89 94 -- 92 90.50 91.67
Mike 90 98 93 94 -- 90 88 92.17 90.67
Tom 79 80 -- 82 -- 87 -- 82.00 83.00
Jim 85 87 79 -- 82 81 -- 82.80 80.67

I only need the formula for the "Last 3" column.

Any ideas?
Jeff...

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Last 3 rounds Average

=AVERAGE(H2:INDEX( A2:H2,SUMPRODUCT(LARGE(COLUMN(A1:H1)*(A2:H2<""),3 ))))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jeff" wrote in message
oups.com...
I need to automate a rolling 3-round average for the golf league. The
scenario is like this: We play 20 weeks. Some folks miss a week or two
so we need a current week average of our last three rounds. I can
certainly figure the last three "weeks" out, but if they're blank, I
need to go back to the last round. Using our first 7 weeks, here's
what I'm trying to accomplish:

Week 1 2 3 4 5 6 7 Overall - Last 3
Jeff 88 87 93 89 94 -- 92 90.50 91.67
Mike 90 98 93 94 -- 90 88 92.17 90.67
Tom 79 80 -- 82 -- 87 -- 82.00 83.00
Jim 85 87 79 -- 82 81 -- 82.80 80.67

I only need the formula for the "Last 3" column.

Any ideas?
Jeff...



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Last 3 rounds Average

This works !!! Thank you!!

I have a few questions though. Do I need to "freeze" the A1:H1 ? So
it would read A$2:H$2? I'm not sure I understand the formula. I've
read the HELP on the formulas but am still not 100% confident. What if
I add 5 more columns?

Thank in advance!
Jeff...

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Last 3 rounds Average

Jeff,

=AVERAGE(H2:INDEX( A2:H2,SUMPRODUCT(LARGE(COLUMN(A1:H1)*(A2:H2<""),3 ))))

The first H2 refers to the last cell in the range of scores, so adjust that.

Column(A1:H1) is used to build an array of column numbers, and is used in
conjunction with (A2:H2<"") to build an array of column numbers for
populated columns. LARGE,..,3 is used to find the 3rd largest, so we only
get the last 3 numbers. I used row 1 in COLUMN(A1:H1) as it does not relate
to the row of data, just the columns. so could just as easily have been
COLUMN(A2:H2). The SUMPRODUCT is just sums the first valid column to itself,
to provide a clean number to the INDEX function.

INDEX(A2:H2, that column value) is then used to get the first cell to count,
and is used in conjunction with the first H2, the last data cell, to get the
3 lasts data cells to AVERAGE.

So ...

The first H2 refers to the last cell in the range of scores, so adjust that.

A2:H2 refers to the data cells being examined, so adjust the H2 in each of
those (note I use A2, even though that may not be a score, but a name
perhaps, so as to keep absolute column numbers, not relative columns.

A1:H1 is used for the columns array, so adjust the H to the last column, and
I would adjust to row 2 as well.

In summary, if you want to extend 5 columns, it would now be

=AVERAGE(M2:INDEX( A2:M2,LARGE(COLUMN(A2:M2)*(A2:M2<""),3)))

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Jeff" wrote in message
ups.com...
This works !!! Thank you!!

I have a few questions though. Do I need to "freeze" the A1:H1 ? So
it would read A$2:H$2? I'm not sure I understand the formula. I've
read the HELP on the formulas but am still not 100% confident. What if
I add 5 more columns?

Thank in advance!
Jeff...



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Last 3 rounds Average

i have something i can send you if you want. did it for my brother a few years
ago.

--


Gary


"Jeff" wrote in message
ups.com...
This works !!! Thank you!!

I have a few questions though. Do I need to "freeze" the A1:H1 ? So
it would read A$2:H$2? I'm not sure I understand the formula. I've
read the HELP on the formulas but am still not 100% confident. What if
I add 5 more columns?

Thank in advance!
Jeff...





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Last 3 rounds Average

Thank you very much!

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Last 3 rounds Average

Gary, thanks forthe offer, but Bob's formula worked perfectly.

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
Excel 2002 always rounds up automatically Kent Excel Worksheet Functions 3 January 29th 10 05:23 AM
Rounds the large numeric value Nilesh.Patel Excel Discussion (Misc queries) 2 January 28th 10 01:13 AM
Round function that rounds down if 5 Mikus Excel Worksheet Functions 5 August 29th 05 11:27 PM
How can set how a number rounds up in excel eric p Excel Worksheet Functions 1 October 28th 04 02:59 AM
Summing rounds answer to Kevin Excel Programming 2 October 13th 04 04:33 PM


All times are GMT +1. The time now is 02:17 AM.

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"