View Full Version : Offset function


noboffinme
09-23-2009, 07:06 PM
Hi

I have been using the OFFSET function & am getting a strange result while using it.

I want to count the columns across a worksheet IF the columns are populated using OFFSET as follows;

=OFFSET(A58,0,0,,A60) - 'A58' is a heading, & 'A60' holds a formula to count the number of populated columns on that row.

Currently, there are 18 populated columns on row 58 so I'm expecting the above formula to give the result of 18, but I get 875 !!

The rest of row 58 is definitely empty & I can't see how Excel calculates 875 from anywhere.

Any help appreciated.

noboffinme
09-23-2009, 08:44 PM
I have the answer after much trial & error

I wasn't aware I could name a Row similar to how I would name a column....

I was originally using a 'COUNTA' function to count the columns across & the way to 'name a row is for row 59 - worksheet name $59:$59.

=OFFSET(autochart!$B$59,0,0,,COUNTA(autochart!$59: $59)) works OK now