Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
StanJ
 
Posts: n/a
Default Using Offset with named ranges

I am using naming conventions for rows and trying to reference cell values
within each row for a calculation. For example:

=OFFSET(namerange,0,0,,) - OFFSET(namerange,0,-2,,)

The formula should return the subtracted difference of two cells from
another worksheet (ex: Sheet1$E$69-Sheet1$C$69). The first segment works
fine. The second segment offset (-2 columns) does not, it returns #REF!.
However, moving the calculation up rows [OFFSET(namerange,-2,0,,)] does work.

Any suggestions?
  #2   Report Post  
arno
 
Posts: n/a
Default

Hi StanJ,

=OFFSET(namerange,0,0,,) - OFFSET(namerange,0,-2,,)

The first segment
works fine. The second segment offset (-2 columns) does not, it
returns #REF!


What is the content of the cell that is in the same row and two
columns to the left of the cell in the upper left corner of range
"namerange"? I think your problem has nothing to do with offset, it's
got to do with what the contents of cells are that you are referring
to. Replace your offset-functions with normal references like =a1-b1
and see if the error still occurs.

arno

  #3   Report Post  
StanJ
 
Posts: n/a
Default

The normal cell reference (=e69-c69) returns the correct answer. I am working
on a cash flow statement calculating the difference between AR in this
instance:

Column E = 9,368.3
Column C = 12,037.9
Difference = -2,669.6

"arno" wrote:

Hi StanJ,

=OFFSET(namerange,0,0,,) - OFFSET(namerange,0,-2,,)

The first segment
works fine. The second segment offset (-2 columns) does not, it
returns #REF!


What is the content of the cell that is in the same row and two
columns to the left of the cell in the upper left corner of range
"namerange"? I think your problem has nothing to do with offset, it's
got to do with what the contents of cells are that you are referring
to. Replace your offset-functions with normal references like =a1-b1
and see if the error still occurs.

arno


  #4   Report Post  
arno
 
Posts: n/a
Default

Hi StanJ,

The normal cell reference (=e69-c69) returns the correct answer.


ok.

what ist the adress of the top-left-cell of range "namerange"?
what ist the result of
=OFFSET(namerange,0,0,,)
and
=OFFSET(namerange,0,-2,,)
and
=row(namerange)
and
=column(namerange)


arno
  #5   Report Post  
StanJ
 
Posts: n/a
Default

I think I see your point now. I am naming entire rows that are out of range
when looking for -2 columns. I assumed that the named range would carry the
logic of address with it as if I were referencing the cell (=namerange) which
would give me the cell's value that corresponds with exact column placement
on a different worksheet.

It still puzzles me why the =offset(namerange,0,0,,) would work as if I just
typed =namerange but that =offset(namerange,0,-2,,) will not.

"arno" wrote:

Hi StanJ,

The normal cell reference (=e69-c69) returns the correct answer.


ok.

what ist the adress of the top-left-cell of range "namerange"?
what ist the result of
=OFFSET(namerange,0,0,,)
and
=OFFSET(namerange,0,-2,,)
and
=row(namerange)
and
=column(namerange)


arno



  #6   Report Post  
arno
 
Posts: n/a
Default

Hi StanJ,

I think I see your point now. I am naming entire rows that are out of
range when looking for -2 columns.


so, if your column C is "myrange", you are in row 14 and you want to
go -2 colums - and you definetily think you need the offset command in
your case (think about it!!!) then you could write into B14:

=offset(myrange,row(b14)-1, -2, 1, 1)

arno

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
Offset Function works in cell, not in named range DragonslayerApps Excel Worksheet Functions 0 July 25th 05 04:39 PM
Like 123, allow named ranges, and print named ranges WP Excel Discussion (Misc queries) 1 April 8th 05 06:07 PM
Macro (Print) - Calling Named Ranges KGlennC Excel Discussion (Misc queries) 1 March 19th 05 09:20 PM
Named Ranges Donna Excel Discussion (Misc queries) 3 February 1st 05 11:35 PM
Named dynamic ranges, copied worksheets and graph source data WP Charts and Charting in Excel 1 November 28th 04 05:19 PM


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