ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   #value! error trying to create a simple dynamic named range (https://www.excelbanter.com/excel-discussion-misc-queries/152935-value-error-trying-create-simple-dynamic-named-range.html)

Janis

#value! error trying to create a simple dynamic named range
 
The lastsix named range is the range I want to average each week but I have
to insert a column so it moves over one if it isn't a dynmic range.

LastSix=OFFSET(Sheet2!AF2,ROW( ), COUNTA(Sheet2!2:2)-6,1,6)

My formula to average each cell in the dynamic column.

=IF(SUM(LastSix)=0,0,ROUNDUP(SUM(LastSix)/COUNTIF(LastSix,"0"),2))


This will be used to build a report from an Access download and as much as
can be dynamic the better.

tia,

Jim Thomlinson

#value! error trying to create a simple dynamic named range
 
As opposed to a Dynamic named range (which I recommended yesterday when I was
not thinking straight about dragging the formula) just use the formula
something like this

OFFSET(A2,0, COUNTA(2:2)-6,1,6)

=IF(SUM(OFFSET(A2,0, COUNTA(2:2)-6,1,6))=0,0,ROUNDUP(SUM(OFFSET(A2,0,
COUNTA(2:2)-6,1,6))/COUNTIF(OFFSET(A2,0, COUNTA(2:2)-6,1,6),"0"),2))

Things to note a
First just get a simple sum working
=sum(OFFSET(A2,0, COUNTA(2:2)-6,1,6))
You may need to modify some of the numbers like the -6 and the A2. Place
this formula in a row other than 2.
I noticed you are referencing AF2... Is that were your data starts. If so
then you are going to need to play around with the offset formula quite a bit
to get it to work.

Finally Offset is a volatile funtion meaning that it is always calculated so
if you have hundreds or thousands of these formulas your performance is going
to suffer.
--
HTH...

Jim Thomlinson


"Janis" wrote:

The lastsix named range is the range I want to average each week but I have
to insert a column so it moves over one if it isn't a dynmic range.

LastSix=OFFSET(Sheet2!AF2,ROW( ), COUNTA(Sheet2!2:2)-6,1,6)

My formula to average each cell in the dynamic column.

=IF(SUM(LastSix)=0,0,ROUNDUP(SUM(LastSix)/COUNTIF(LastSix,"0"),2))


This will be used to build a report from an Access download and as much as
can be dynamic the better.

tia,



All times are GMT +1. The time now is 03:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com