ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   SUM Function (https://www.excelbanter.com/excel-discussion-misc-queries/151540-sum-function.html)

Shawn

SUM Function
 
How do I stop the function from moving if I insert cells? For example, if my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


Mike

SUM Function
 
Try this
SUM($B$1:$B$6)


"Shawn" wrote:

How do I stop the function from moving if I insert cells? For example, if my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


Shawn

SUM Function
 
They still moved....

"Mike" wrote:

Try this
SUM($B$1:$B$6)


"Shawn" wrote:

How do I stop the function from moving if I insert cells? For example, if my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


Elkar

SUM Function
 
Perhaps this will work:

=SUM(INDIRECT(ADDRESS(1,2)&":"&ADDRESS(6,2)))

HTH,
Elkar


"Shawn" wrote:

They still moved....

"Mike" wrote:

Try this
SUM($B$1:$B$6)


"Shawn" wrote:

How do I stop the function from moving if I insert cells? For example, if my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


David Biddulph[_2_]

SUM Function
 
=SUM(INDIRECT("B1"):INDIRECT("B6"))
--
David Biddulph

"Shawn" wrote in message
...
How do I stop the function from moving if I insert cells? For example, if
my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)




Harlan Grove[_4_]

SUM Function
 
"Shawn" wrote...
How do I stop the function from moving if I insert cells? For example, if my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


An obvious question is why would you insert cells in this range when you
know you have formulas referring to it? There are often better approaches
than frequent insertion or deletion.

Still, as an academic exercise, the simplest approach would be

=SUM(INDIRECT("B1:B6"))

The INDIRECT function is volatile, so this formula would recalculate every
time anything triggers recalc. If you have lots of such formulas, it could
noticeably slow recalculation.

RagDyeR

SUM Function
 
BUT ... if you're *only* going to insert rows at *Row1*, you can try this
non-volatile formula:

=SUM(INDEX(B:B,ROWS($1:$1)):INDEX(B:B,ROWS($1:$6)) )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Harlan Grove" wrote in message
...
"Shawn" wrote...
How do I stop the function from moving if I insert cells? For example, if
my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


An obvious question is why would you insert cells in this range when you
know you have formulas referring to it? There are often better approaches
than frequent insertion or deletion.

Still, as an academic exercise, the simplest approach would be

=SUM(INDIRECT("B1:B6"))

The INDIRECT function is volatile, so this formula would recalculate every
time anything triggers recalc. If you have lots of such formulas, it could
noticeably slow recalculation.




JMB

SUM Function
 
Why not

=SUM(INDEX(B:B,1):INDEX(B:B,6))



"Ragdyer" wrote:

BUT ... if you're *only* going to insert rows at *Row1*, you can try this
non-volatile formula:

=SUM(INDEX(B:B,ROWS($1:$1)):INDEX(B:B,ROWS($1:$6)) )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Harlan Grove" wrote in message
...
"Shawn" wrote...
How do I stop the function from moving if I insert cells? For example, if
my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)


An obvious question is why would you insert cells in this range when you
know you have formulas referring to it? There are often better approaches
than frequent insertion or deletion.

Still, as an academic exercise, the simplest approach would be

=SUM(INDIRECT("B1:B6"))

The INDIRECT function is volatile, so this formula would recalculate every
time anything triggers recalc. If you have lots of such formulas, it could
noticeably slow recalculation.





RagDyeR

SUM Function
 
Why not?

Simple ... I just didn't think about it!<bg
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"JMB" wrote in message
...
Why not

=SUM(INDEX(B:B,1):INDEX(B:B,6))



"Ragdyer" wrote:

BUT ... if you're *only* going to insert rows at *Row1*, you can try this
non-volatile formula:

=SUM(INDEX(B:B,ROWS($1:$1)):INDEX(B:B,ROWS($1:$6)) )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Harlan Grove" wrote in message
...
"Shawn" wrote...
How do I stop the function from moving if I insert cells? For example,
if
my
function is SUM(B1:B6) and I insert cells it changes it to
SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)

An obvious question is why would you insert cells in this range when
you
know you have formulas referring to it? There are often better
approaches
than frequent insertion or deletion.

Still, as an academic exercise, the simplest approach would be

=SUM(INDIRECT("B1:B6"))

The INDIRECT function is volatile, so this formula would recalculate
every
time anything triggers recalc. If you have lots of such formulas, it
could
noticeably slow recalculation.







Shawn

SUM Function
 
That worked, thanks!!

"JMB" wrote:

Why not

=SUM(INDEX(B:B,1):INDEX(B:B,6))



"Ragdyer" wrote:

BUT ... if you're *only* going to insert rows at *Row1*, you can try this
non-volatile formula:

=SUM(INDEX(B:B,ROWS($1:$1)):INDEX(B:B,ROWS($1:$6)) )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"Harlan Grove" wrote in message
...
"Shawn" wrote...
How do I stop the function from moving if I insert cells? For example, if
my
function is SUM(B1:B6) and I insert cells it changes it to SUM(B2:B7).....

I'd like it to stay SUM(B1:B6)

An obvious question is why would you insert cells in this range when you
know you have formulas referring to it? There are often better approaches
than frequent insertion or deletion.

Still, as an academic exercise, the simplest approach would be

=SUM(INDIRECT("B1:B6"))

The INDIRECT function is volatile, so this formula would recalculate every
time anything triggers recalc. If you have lots of such formulas, it could
noticeably slow recalculation.






All times are GMT +1. The time now is 10:27 PM.

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