ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How do I fix cell refs when adding rows (https://www.excelbanter.com/excel-discussion-misc-queries/58143-how-do-i-fix-cell-refs-when-adding-rows.html)

Dave L

How do I fix cell refs when adding rows
 
Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave

Stefi

How do I fix cell refs when adding rows
 
=sum(a$1:a5)

Regards,
Stefi

€žDave L€ť ezt Ă*rta:

Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave


Dave L

How do I fix cell refs when adding rows
 
$ doesn't work when you insert extra rows

"Stefi" wrote:

=sum(a$1:a5)

Regards,
Stefi

€žDave L€ť ezt Ă*rta:

Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave


Stefi

How do I fix cell refs when adding rows
 
Sorry, I didn't test my answer thoroughly! I made additional test and got the
following: if you insert new row before row 1 then formula changes to
=SUM(A2:A6).
if you insert new row before row 6 (row of SUM), then formula remains
=SUM(A1:A5) with an empty row 6.
But if you insert new row before any other row (2-5) then formula changes to
=SUM(A1:A6).

Regards,
Stefi

€žDave L€ť ezt Ă*rta:

$ doesn't work when you insert extra rows

"Stefi" wrote:

=sum(a$1:a5)

Regards,
Stefi

€žDave L€ť ezt Ă*rta:

Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave


Ron Coderre

How do I fix cell refs when adding rows
 
I think this does what you want:
=SUM(INDIRECT("A1:A"&ROW(A5)))

Does that help?

***********
Regards,
Ron


"Dave L" wrote:

Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave


Dave L

How do I fix cell refs when adding rows
 
Thanks Ron and Steffi

"Ron Coderre" wrote:

I think this does what you want:
=SUM(INDIRECT("A1:A"&ROW(A5)))

Does that help?

***********
Regards,
Ron


"Dave L" wrote:

Is there any way for me to insert a row without changing a cell ref in a
formula eg =sum(a1:a5) instead of changing to A2:A6 I want A1:A6 ie the range
increases in line with the added row.

TIA
Dave



All times are GMT +1. The time now is 06:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com