Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Relative reference to current cell?

Is there a simple way for a cell formula to refer to its own cell?

I can get my own column by using =COLUMN(), I can get my own row by
using =ROW(). How can I get my own CELL ?

I like to use C1=OFFSET(C1,-1,0) as a cut/copy/paste/delete-safe
formula which refers to the value immediately above the current cell.
The only trouble is in discussing formulas with others. I cannot say
"use =OFFSET(B44,-1,0)" without further saying that that formula will
only work in cell B44.

Is there an equivalent to =OFFSET(ME(),-1,0) ?

I have tried =OFFSET(,-1,0) but that is a syntax error.

The best I have yet come up with is the following:

=INDIRECT(CONCATENATE("R",TEXT(ROW()-1,0),"C",TEXT(COLUMN(),0)),0)

Can anyone do it better?

Brian Herbert Withun

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Relative reference to current cell?

On Nov 7, 2:51 pm, Brian Herbert Withun wrote:
Is there a simple way for a cell formula to refer to its own cell?

I can get my own column by using =COLUMN(), I can get my own row by
using =ROW(). How can I get my own CELL ?

I like to use C1=OFFSET(C1,-1,0) as a cut/copy/paste/delete-safe
formula which refers to the value immediately above the current cell.
The only trouble is in discussing formulas with others. I cannot say
"use =OFFSET(B44,-1,0)" without further saying that that formula will
only work in cell B44.

Is there an equivalent to =OFFSET(ME(),-1,0) ?

I have tried =OFFSET(,-1,0) but that is a syntax error.

The best I have yet come up with is the following:

=INDIRECT(CONCATENATE("R",TEXT(ROW()-1,0),"C",TEXT(COLUMN(),0)),0)

Can anyone do it better?

Brian Herbert Withun


I've just come up with a better one:

=OFFSET($A$1,ROW()-2,COLUMN()-1)

but is this the simplest form?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Relative reference to current cell?

The best I have yet come up with is the following:

=INDIRECT(CONCATENATE("R",TEXT(ROW()-1,0),"C",TEXT(COLUMN(),0)),0)

Can anyone do it better?

Brian Herbert Withun


I've just come up with a better one:

=OFFSET($A$1,ROW()-2,COLUMN()-1)

but is this the simplest form?


You could have made your initial formula better to look at by using the
ampersand to concatenate your text together instead of using the CONCATENATE
function....

=INDIRECT("R"&ROW()-1&"C"&COLUMN(),0)

Another possibility using INDIRECT is this...

=INDIRECT(ADDRESS(ROW()-1,COLUMN()))

Which of the 3 formulas is "better"? Being they are all volatile, I have no
idea.

Rick

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Relative reference to current cell?

I've just come up with a better one:

=OFFSET($A$1,ROW()-2,COLUMN()-1)

but is this the simplest form?


You could have made your initial formula better to look at by using the
ampersand to concatenate your text together instead of using the
CONCATENATE function....

=INDIRECT("R"&ROW()-1&"C"&COLUMN(),0)

Another possibility using INDIRECT is this...

=INDIRECT(ADDRESS(ROW()-1,COLUMN()))

Which of the 3 formulas is "better"? Being they are all volatile, I have
no idea.


Although I don't believe this formula is volatile...

=INDEX(1:65536,ROW()-1,COLUMN())

Rick

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
Relative/Current Cell Reference in Hyperlinks cncf Excel Discussion (Misc queries) 0 June 1st 08 09:46 PM
Relative cell reference Roar Excel Discussion (Misc queries) 1 May 25th 07 01:23 PM
Macro to run relative to current selected cell MahD Excel Discussion (Misc queries) 3 December 11th 06 06:18 AM
Relative Cell Reference [How To] Rob Excel Programming 2 September 23rd 06 02:43 AM
Relative Cell Reference Keith Excel Worksheet Functions 2 August 10th 06 05:22 AM


All times are GMT +1. The time now is 11:20 PM.

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"