Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refer to row as variable in Excel

Status
Not open for further replies.

stillinlife101

Programmer
Feb 15, 2005
29
US
How might I refer to the row in which a cell is? If I want to reference the F column in row 43 from C43, how could I use the fact that C is in row 43 to get F43? The application would be equations that could be reused in inventory-type spreadsheets.

Thanks,
Dan
 
Type in [COLOR=blue white]=F43[/color] into cell C43 then copy that cell and paste it elsewhere. What you see happening is called Relative Referencing. The formula will automatically adjust to refer to the cell three to the right of where it is pasted. In short, you probably don't need to do anything.

Have a look at Relative Reference vs. Absolute Reference in Excel's help.

[tt]_____
[blue]-John[/blue][/tt]

"Patriotism is your conviction that this country is superior to all other countries because you were born in it."
[tab]-George Bernard Shaw

Help us help you. Please read FAQ181-2886 before posting.
 
You might also want to take a look at "R1C1 reference style" -- See Tools/Options/General

When "R1C1 reference style" is ticked, you can enter a formula like
[tt]
=RC[3]
[/tt]
which is interpreted as "same row, three columns to the right." When pasted in to cell C43, it would be referring to cell F43.

But to answer your original question, you could use the formula
[tt]
=ROW(C43)
[/tt]
which produces the value 43.

You may also want to take a look at the [tt] INDIRECT [/tt] function in the help file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top