ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Absolute References and Inserting columns (https://www.excelbanter.com/excel-discussion-misc-queries/220878-absolute-references-inserting-columns.html)

BobK

Absolute References and Inserting columns
 
I've created a formula in column A that adds up some cells in column D. Ex:
=sum(D3:D6). If I insert one column in front of column D, the formula changes
to =sum(E3:E6). This happens even if I change the formula to =sum($D$3:$D$6).
I also tried creating a range name called TEST referring to the original
$D$3:$D$6 range and the column insertion changed the TEST range definition as
well.

Is there a way to keep a formula from NOT adjusting to column insertions or
deletions? Thanks in advance!

Sheeloo[_3_]

Absolute References and Inserting columns
 
You need to use the INDIRECT function.

Instead of
=sum($D$3:$D$6)

use
=SUM(INDIRECT("$D$3:$D$6"))

Of course you won't be able to copy this formula down.

If you want that then you need to use ROW() and/or COLUMN() formulas to
build the reference...

"BobK" wrote:

I've created a formula in column A that adds up some cells in column D. Ex:
=sum(D3:D6). If I insert one column in front of column D, the formula changes
to =sum(E3:E6). This happens even if I change the formula to =sum($D$3:$D$6).
I also tried creating a range name called TEST referring to the original
$D$3:$D$6 range and the column insertion changed the TEST range definition as
well.

Is there a way to keep a formula from NOT adjusting to column insertions or
deletions? Thanks in advance!



All times are GMT +1. The time now is 02:47 PM.

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