Reference Previous Row with ROW

D

donc

This seems pretty straightforward, but I don't get good results with
anything I've tried.

I want to reference the previous row in a (simple) formula so that if a
blank row is inserted above, the formula refers to the new blank row
instead of the old previous row, which is now one row further up.

=ROW() gives me the row number of a cell. I figure that =$D(row()-1)
should refer to the previous row, column D. But it don't.

Is there a simple way to do this?

Thanks for any help.

donc
 
M

Myrna Larson

Sounds to me like you could use an offset formula.

This one sits in cell A6, and it refers to the cell one row above itself.

=OFFSET(A6,-1,0)

If you insert a new row 6, the formula will change to =OFFSET(A7,-1,0), i.e.
it will refer to the new blank row you just inserted.
 
H

hgrove

donc wrote...
...
. . . I figure that =$D(row()-1) should refer to the previous row,
column D. But it don't.
...

If you're entering this in col D, try

=INDIRECT("R[-1]C",0)

If you're entering this in some other col, maybe hard-code the col

=INDIRECT("R[-1]C4",0
 
D

donc

The INDIRECT method works very well... I now understand what INDIRECT is
doing.

Thanks All.

donc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top