Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Return values from the row above to the current row

I am trying to do simple thing: I just need to set some cells to values that are on the previous rows. I have tried =A(Row()-1) but it does not work.

like image 228
Bliznak Avatar asked Aug 23 '10 15:08

Bliznak


People also ask

How do you reference a row above in Excel?

Is there a way to reference the cell above? The simple way is to reference using [COLUMN_NAME]2 (the number being the current row number minus one).

How do you look up a value and return the cell above or below?

If you want to look up for a value and return below and the 3 cells to the right of the reference, you can apply this formula =INDEX(F1:H8,MATCH(K1,F1:F8,0)+1,3).

How do you return a value from a row in Excel?

Return a value if a given value exists in a certain range by using a formula. Please apply the following formula to return a value if a given value exists in a certain range in Excel. 1. Select a blank cell, enter formula =VLOOKUP(E2,A2:C8,3, TRUE) into the Formula Bar and then press the Enter key.


1 Answers

To solve this problem in Excel, usually I would just type in the literal row number of the cell above, e.g., if I'm typing in Cell A7, I would use the formula =A6. Then if I copied that formula to other cells, they would also use the row of the previous cell.

Another option is to use Indirect(), which resolves the literal statement inside to be a formula. You could use something like:

=INDIRECT("A" & ROW() - 1) 

The above formula will resolve to the value of the cell in column A and the row that is one less than that of the cell which contains the formula.

like image 126
Ben McCormack Avatar answered Oct 18 '22 09:10

Ben McCormack