Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Average values in only last 6 columns

I have a sheet with data in columns.

The field starts in D2 and continues column by column with a new
column each week.

Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.

Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.

The columns will populate as data loads and I need this dynamic
average to automatically update.

Your assistance is greatly appreciated

Don Flak
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Average values in only last 6 columns

=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2:CL 2)-COLUMN(D2)+1)))))

this is an array formula, so commit with Ctrl-SHift-Enter


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
I have a sheet with data in columns.

The field starts in D2 and continues column by column with a new
column each week.

Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.

Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.

The columns will populate as data loads and I need this dynamic
average to automatically update.

Your assistance is greatly appreciated

Don Flak



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Average values in only last 6 columns

=AVERAGE(OFFSET(A2,,COUNT(A2:CL2),1,-7))


" wrote:

I have a sheet with data in columns.

The field starts in D2 and continues column by column with a new
column each week.

Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.

Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.

The columns will populate as data loads and I need this dynamic
average to automatically update.

Your assistance is greatly appreciated

Don Flak

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Average values in only last 6 columns

On Jun 4, 9:58*am, "Bob Phillips" wrote:
=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN*DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2:C L2)-COLUMN(D2)+1)))))

this is an array formula, so commit with Ctrl-SHift-Enter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

...



I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. *In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Thanks so much Bob, that worked perfectly

Don
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Average values in only last 6 columns

On Jun 4, 9:58*am, "Bob Phillips" wrote:
=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN*DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2:C L2)-COLUMN(D2)+1)))))

this is an array formula, so commit with Ctrl-SHift-Enter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

...



I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. *In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Oops, I spoke too soon.

I am getting the average of the last 7 values instead of 6

Specifically the data looks like

Column / Cell
AF4 AG4 AH4 AI4 AJ4
AK4 AL4 CN4
WEEK 29 WEEK 30 WEEK 31 WEEK 32 WEEK 33 WEEK 34 WEEK 35 6
Week Avg.

3.80% 0.60% -1.00% -1.30% -1.40% -5.40% -1.70% -0.91%

Here's the exact formula I am using

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-
COLUMN(D4)-5))):(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL 4)-
COLUMN(D4)+1)))))

What am I do wrong?





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Average values in only last 6 columns

Did you array enter it? I get -0.91% using that formula.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
On Jun 4, 9:58 am, "Bob Phillips" wrote:
=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN*DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2:C L2)-COLUMN(D2)+1)))))

this is an array formula, so commit with Ctrl-SHift-Enter

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

wrote in message

...



I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Oops, I spoke too soon.

I am getting the average of the last 7 values instead of 6

Specifically the data looks like

Column / Cell
AF4 AG4 AH4 AI4 AJ4
AK4 AL4 CN4
WEEK 29 WEEK 30 WEEK 31 WEEK 32 WEEK 33 WEEK 34 WEEK 35 6
Week Avg.

3.80% 0.60% -1.00% -1.30% -1.40% -5.40% -1.70% -0.91%

Here's the exact formula I am using

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-
COLUMN(D4)-5))):(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL 4)-
COLUMN(D4)+1)))))

What am I do wrong?




  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Average values in only last 6 columns

On Jun 4, 2:40*pm, "Bob Phillips" wrote:
Did you array enter it? I get -0.91% using that formula.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

...
On Jun 4, 9:58 am, "Bob Phillips" wrote:





=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN**DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2: CL2)-COLUMN(D2)+1)))))


this is an array formula, so commit with Ctrl-SHift-Enter


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


wrote in message


...


I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Oops, I spoke too soon.

I am getting the average of the last 7 values instead of 6

Specifically the data looks like

Column / Cell
* *AF4 * * * * * *AG4 * * * *AH4 * * * * *AI4 * * * * * AJ4
AK4 * * * * *AL4 * * * * * * * * * *CN4
WEEK 29 WEEK 30 WEEK 31 WEEK 32 WEEK 33 WEEK 34 WEEK 35 * * * * *6
Week Avg.

3.80% 0.60% -1.00% -1.30% -1.40% -5.40% -1.70% * * * * * * *-0.91%

Here's the exact formula I am using

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-
COLUMN(D4)-5))):(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL 4)-
COLUMN(D4)+1)))))

What am I do wrong?- Hide quoted text -

- Show quoted text -


Yes, I did use the array, the problem is the -0.91 is not the correct
answer for the 6 week average. the correct answer would be -1.70.
The -0.91 is the 7 week average. That's why I included the week 29
value because somehow it is being included in the calculation.
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Average values in only last 6 columns

Okay, spotted my error

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-COLUMN(D4)+1))-5):
INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL4)-COLUMN(D4)+1))))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



wrote in message
...
On Jun 4, 2:40 pm, "Bob Phillips" wrote:
Did you array enter it? I get -0.91% using that formula.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

wrote in message

...
On Jun 4, 9:58 am, "Bob Phillips" wrote:





=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN**DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2: CL2)-COLUMN(D2)+1)))))


this is an array formula, so commit with Ctrl-SHift-Enter


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


wrote in message


...


I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Oops, I spoke too soon.

I am getting the average of the last 7 values instead of 6

Specifically the data looks like

Column / Cell
AF4 AG4 AH4 AI4 AJ4
AK4 AL4 CN4
WEEK 29 WEEK 30 WEEK 31 WEEK 32 WEEK 33 WEEK 34 WEEK 35 6
Week Avg.

3.80% 0.60% -1.00% -1.30% -1.40% -5.40% -1.70% -0.91%

Here's the exact formula I am using

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-
COLUMN(D4)-5))):(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL 4)-
COLUMN(D4)+1)))))

What am I do wrong?- Hide quoted text -

- Show quoted text -


Yes, I did use the array, the problem is the -0.91 is not the correct
answer for the 6 week average. the correct answer would be -1.70.
The -0.91 is the 7 week average. That's why I included the week 29
value because somehow it is being included in the calculation.


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 41
Default Average values in only last 6 columns

On Jun 5, 10:54*am, "Bob Phillips" wrote:
Okay, spotted my error

=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-COLUMN(D4)+1))-5):
INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL4)-COLUMN(D4)+1))))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

...
On Jun 4, 2:40 pm, "Bob Phillips" wrote:





Did you array enter it? I get -0.91% using that formula.


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


wrote in message


...
On Jun 4, 9:58 am, "Bob Phillips" wrote:


=AVERAGE(INDEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)-5))):(IN***DEX(D2:CL2,,MAX(IF(D2:CL2<"",COLUMN(D2 :CL2)-COLUMN(D2)+1)))))


this is an array formula, so commit with Ctrl-SHift-Enter


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


wrote in message


....


I have a sheet with data in columns.


The field starts in D2 and continues column by column with a new
column each week.


Currently data is populated through AL2 but will continue all the way
to CL2. In CN2 I need a formula that will calculate the average of
the last 6 entries.


Currently that would be AG2:AL2 but next week that would need to be
AH2:AM2 and so one.


The columns will populate as data loads and I need this dynamic
average to automatically update.


Your assistance is greatly appreciated


Don Flak- Hide quoted text -


- Show quoted text -


Oops, I spoke too soon.


I am getting the average of the last 7 values instead of 6


Specifically the data looks like


Column / Cell
AF4 AG4 AH4 AI4 AJ4
AK4 AL4 CN4
WEEK 29 WEEK 30 WEEK 31 WEEK 32 WEEK 33 WEEK 34 WEEK 35 6
Week Avg.


3.80% 0.60% -1.00% -1.30% -1.40% -5.40% -1.70% -0.91%


Here's the exact formula I am using


=AVERAGE(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4 :CL4)-
COLUMN(D4)-5))):(INDEX(D4:CL4,,MAX(IF(D4:CL4<"",COLUMN(D4:CL 4)-
COLUMN(D4)+1)))))


What am I do wrong?- Hide quoted text -


- Show quoted text -


Yes, I did use the array, the problem is the -0.91 is not the correct
answer for the 6 week average. *the correct answer would be -1.70.
The -0.91 is the 7 week average. *That's why I included the week 29
value because somehow it is being included in the calculation.- Hide quoted text -

- Show quoted text -


That did the trick. Thanks so much.
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
A formula to AVERAGE IF but only average a set number of values [email protected] Excel Worksheet Functions 2 January 31st 08 08:28 PM
average values in non-contiguous cells, ignoring 0 values RWormdahl Excel Worksheet Functions 3 October 30th 06 01:06 AM
Average AM or PM values David Excel Discussion (Misc queries) 9 May 6th 06 02:31 PM
Looking-up Columns w/calc'd Values ONLY to Calculate Average sony654 Excel Worksheet Functions 5 April 21st 06 06:21 AM
Error Handling #N/A with AVERAGE Function - Average of values in Row Sam via OfficeKB.com Excel Worksheet Functions 13 July 31st 05 03:59 PM


All times are GMT +1. The time now is 11:39 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"