SOLVED

Using the number in a cell as the row reference in other.

Copper Contributor

I have a table to which I need to keep adding rows.

At the end of the table, I have several cells taking the values of the last row, and it makes me change the row number in then all every time I add a row.

It would help me a lot if I could  could do this:

Let's say I want the value of F3 in E8.

Instead of writing =F3 in E8, I want to put the the row number 3 in D4 and write a formula in E8 that takes the column F and the row number 3 I wrote in D4.

Please, help

 

 

9 Replies
best response confirmed by eviera49 (Copper Contributor)
Solution

@eviera49 

The function that performs the task you describe is

=INDIRECT("F"&D4)

Another option is to use INDEX

= INDEX(F:F, D4)

I tend to use defined names rather than cell references e.g.

= INDEX( data, instance )

but that is a matter of personal preference.

@eviera49 

Most probably it's not necessary to enter row number, it could be calculatable. Especially if use Excel Tables, not ranges.

@Peter Bartholomew 

Thanks! Peter!!

It works perfectly.

You've been so helpful.

 

@Sergei Baklan 

Thanks a lot Sergei.

Perhaps this solution is better for people who knows more than I do.

 

@eviera49 

Help!

Is there any way I can use other formula if I add N columns?

@eviera49 

Have you looked at @Sergei Baklan 's suggestion of using Excel Tables.  That provides a name for the data range that adjusts as data is added.  The primary use of this functionality to keep track of the number of records in the Table but, if you add fields/columns that works too.

 

The key point is that the formulas

= ROWS(Table1)

= COLUMNS(Table1)

keep track of the Table size, so that 

= INDEX( Table1, 0, COLUMNS(Table1)),

for example, is the right-most field of the table.

@Peter Bartholomew 

 

Thanks for helping me again.

 

Please see the whole explanation of the problem in the following post:

https://techcommunity.microsoft.com/t5/excel/using-the-number-in-a-cell-as-the-number-of-columns-add...

 

@Peter Bartholomew I have a formula in one sheet where I am taking data from another sheet therefore using this type of formula "=Sheet2!D26" - I've tried using your suggestions above but it comes up invalid. I have tried the following:

"=Sheet2!(INDIRECT("D"&J2)"

"=Sheet2!(=(INDIRECT("D"&J2))"

"=Sheet2!(INDIRECT("D",J2)"

"=Sheet2!(=(INDIRECT("D",J2))"

And the same with the INDEX function. Is this not possible to do when taking data from another sheet? The J2 is from the current sheet. Any help welcome. thanks. 

 

@mikemitch 

The sheet name forms part of the string to be converted to the reference

= INDIRECT("Sheet2!D"&J2)

 

 

1 best response

Accepted Solutions
best response confirmed by eviera49 (Copper Contributor)
Solution

@eviera49 

The function that performs the task you describe is

=INDIRECT("F"&D4)

Another option is to use INDEX

= INDEX(F:F, D4)

I tend to use defined names rather than cell references e.g.

= INDEX( data, instance )

but that is a matter of personal preference.

View solution in original post