Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass row number as variable in excel sheet

Suppose I have:

  1. a value of 5 in B1
  2. I want to pass the number (5) in B1 as a row variable, which will be read in conjunction with column A into another cell (say C1) as "=A(B1)" i.e. "=A5"

How would I do this?

like image 915
Yashpal Singla Avatar asked Nov 06 '12 07:11

Yashpal Singla


People also ask

How do you reference a number in Excel cell?

Using Excel INDIRECT function to lock a cell referenceEnter any value in any cell, say, number 20 in cell A1. Refer to A1 from two other cells in different ways: =A1 and =INDIRECT("A1") Insert a new row above row 1.

How do I capture a row number?

Getting a row number is easy—just find the cell you're interested in, click on it, and look at the highlighted row number on the side of the window. Sometimes, however, you need to use that information in a function. That's where ROW comes in. This function can be run with no arguments.


2 Answers

Assuming your row number is in B1, you can use INDIRECT:

=INDIRECT("A" & B1) 

This takes a cell reference as a string (in this case, the concatenation of A and the value of B1 - 5), and returns the value at that cell.

like image 168
RocketDonkey Avatar answered Sep 27 '22 00:09

RocketDonkey


This should do the trick! :)

B1 =ROW(A5)

http://www.techonthenet.com/excel/formulas/row.php

like image 42
CustomX Avatar answered Sep 27 '22 00:09

CustomX