View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave F Dave F is offline
external usenet poster
 
Posts: 2,574
Default OFFSET function in named range returning wrong # of rows

What are you trying to do with OFFSET? OFFSET has the following arguments:
=OFFSET(reference,rows,cols,height,width) of which arguments the first three
are required. With your formula
=OFFSET(PivotMONTH!$G$4,0,0,(COUNTIF(PivotMONTH!$I :$I,"0")),5) it looks like
your nested COUNTIF is the height argument of OFFSET

Assuming your intentions square with the above, which column do the 0 values
occur in?

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"Heidi" wrote:

I am trying to create a dynamically named range. However, the range keeps
selecting too many cells.

This function: =COUNTIF(PivotMONTH!$I:$I,"0") returns 47, which is the
correct number of rows.

However, this named range which contains the above function:
=OFFSET(PivotMONTH!$G$4,0,0,(COUNTIF(PivotMONTH!$I :$I,"0")),5) returns a
range 58 rows long. My data does indeed have 58 rows, but the last few rows
are just zeroes. My COUNTIF function should eliminate those rows. Why does
my countif return the correct number of rows when it stands alone, but an
incorrect number when it is used in the named range?

Thanks!
Heidi