ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I sum using relative cell positions? (https://www.excelbanter.com/excel-worksheet-functions/23711-how-do-i-sum-using-relative-cell-positions.html)

DavidB

How do I sum using relative cell positions?
 
I want to set up a formula that calculates a sum based on the data in the 12
columns to the left of the calculation cell. Something like:
SUM(RC[-12]:RC[-1]), *but* if I insert a column to the left, I don't want the
reference to be adjusted to SUM(RC[-13]:RC[-2]).
Probably a simple answer, but I'm stumped.
Thanks,

John Mansfield

DavidB,

Try using the INDIRECT worksheet function to "freeze" the columns . . .
something like:

=SUM(INDIRECT("A1:L1"))

----
Regards,
John Mansfield
http://www.pdbook.com


"DavidB" wrote:

I want to set up a formula that calculates a sum based on the data in the 12
columns to the left of the calculation cell. Something like:
SUM(RC[-12]:RC[-1]), *but* if I insert a column to the left, I don't want the
reference to be adjusted to SUM(RC[-13]:RC[-2]).
Probably a simple answer, but I'm stumped.
Thanks,



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

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