Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Marie J-son
 
Posts: n/a
Default Excel change SUM references if you cut & paste the first cell in SUM...

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and in A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in A8 has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards


  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I think the developers had to make a decision. The one that they came up with
was if you cut a cell out of the middle of a range, then trust the user to know
that they don't want to change that formula.

But if they cut a cell from a cell in that formula (top or bottom cell), then
they figured that the user wanted to extend the range to include the new
position of the pasted cell.

(It seems like a pretty reasonable approach to me--I'm not sure I'd want any
other way.)

Possible work arounds...
Use copy instead of Cut. then Clear the cell in the original location after you
pasted.

modify the formula to be based on the position of the cell with the formula.

In A8:
Instead of
=sum(a9:a13)
how about:
=SUM(OFFSET(A8,1,0,4,1))

Starting in A8, come down 1 row, to the right 0 columns for a total of 4 rows
and 1 column)

You may want to look at David McRitchie's site to see how he explains using
=offset() to keep formulas from adjusting.

http://www.mvps.org/dmcritchie/excel/offset.htm

You might find something a little more useful.

Marie J-son wrote:

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and in A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in A8 has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards


--

Dave Peterson
  #3   Report Post  
Marie J-son
 
Posts: n/a
Default

Thank you Dave,

OK, maybe I should try offset. Right now however, I made a workaround by
restore the formulas with a worksheet_change procedure and with a
errorhandler "on error goto 0" take away the error box about cirular
references you get if you drag n drop / cut/paste the A9 cell to A4.

I have a number of tables where the users will like to move cells around, to
tables above and below. There will mostly be the "circular references error
box" poping up all the time.

Question: I shouldn't take away all error messages like I've done now, but
couldn't find a way to eliminate "error for circular references" only. Do
you or anybody else have a clue? I could't find a error number to check with
in a error handler. Maybe the offset method Dave decribed is better...?

/Regards


"Dave Peterson" skrev i meddelandet
...
I think the developers had to make a decision. The one that they came up
with
was if you cut a cell out of the middle of a range, then trust the user to
know
that they don't want to change that formula.

But if they cut a cell from a cell in that formula (top or bottom cell),
then
they figured that the user wanted to extend the range to include the new
position of the pasted cell.

(It seems like a pretty reasonable approach to me--I'm not sure I'd want
any
other way.)

Possible work arounds...
Use copy instead of Cut. then Clear the cell in the original location
after you
pasted.

modify the formula to be based on the position of the cell with the
formula.

In A8:
Instead of
=sum(a9:a13)
how about:
=SUM(OFFSET(A8,1,0,4,1))

Starting in A8, come down 1 row, to the right 0 columns for a total of 4
rows
and 1 column)

You may want to look at David McRitchie's site to see how he explains
using
=offset() to keep formulas from adjusting.

http://www.mvps.org/dmcritchie/excel/offset.htm

You might find something a little more useful.

Marie J-son wrote:

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and in
A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in A8
has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards


--

Dave Peterson



  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

Ahhhh.

You always want your sum to point at the same range (A9:A13) no matter where the
users drag and drop cells??

If that's the case, you can use something like this:

=SUM(INDIRECT("A9:A13"))

Be aware that if you insert/delete rows or columns, then this formula will still
point at A9:A13. (that string "a9:a13" won't change like a cell reference.



Marie J-son wrote:

Thank you Dave,

OK, maybe I should try offset. Right now however, I made a workaround by
restore the formulas with a worksheet_change procedure and with a
errorhandler "on error goto 0" take away the error box about cirular
references you get if you drag n drop / cut/paste the A9 cell to A4.

I have a number of tables where the users will like to move cells around, to
tables above and below. There will mostly be the "circular references error
box" poping up all the time.

Question: I shouldn't take away all error messages like I've done now, but
couldn't find a way to eliminate "error for circular references" only. Do
you or anybody else have a clue? I could't find a error number to check with
in a error handler. Maybe the offset method Dave decribed is better...?

/Regards

"Dave Peterson" skrev i meddelandet
...
I think the developers had to make a decision. The one that they came up
with
was if you cut a cell out of the middle of a range, then trust the user to
know
that they don't want to change that formula.

But if they cut a cell from a cell in that formula (top or bottom cell),
then
they figured that the user wanted to extend the range to include the new
position of the pasted cell.

(It seems like a pretty reasonable approach to me--I'm not sure I'd want
any
other way.)

Possible work arounds...
Use copy instead of Cut. then Clear the cell in the original location
after you
pasted.

modify the formula to be based on the position of the cell with the
formula.

In A8:
Instead of
=sum(a9:a13)
how about:
=SUM(OFFSET(A8,1,0,4,1))

Starting in A8, come down 1 row, to the right 0 columns for a total of 4
rows
and 1 column)

You may want to look at David McRitchie's site to see how he explains
using
=offset() to keep formulas from adjusting.

http://www.mvps.org/dmcritchie/excel/offset.htm

You might find something a little more useful.

Marie J-son wrote:

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and in
A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in A8
has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards


--

Dave Peterson


--

Dave Peterson
  #5   Report Post  
Marie J-son
 
Posts: n/a
Default

Thank you again!

Dave, I have tried both INDIRECT and OFFSET and they both work well. Do you
find INDIRECT better than OFFSET? It seems like OFFSET also keep the same
target sum area when I move around the cells, cut & paste etc. (I haven't
tried drag n' drop from other worksheets yet, hopefully that will not make a
differense).

It is not possible today to change rows or columns, it is locked, but maybe
I will develope it otherwice later on.

/Regards


"Dave Peterson" skrev i meddelandet
...
Ahhhh.

You always want your sum to point at the same range (A9:A13) no matter
where the
users drag and drop cells??

If that's the case, you can use something like this:

=SUM(INDIRECT("A9:A13"))

Be aware that if you insert/delete rows or columns, then this formula will
still
point at A9:A13. (that string "a9:a13" won't change like a cell
reference.



Marie J-son wrote:

Thank you Dave,

OK, maybe I should try offset. Right now however, I made a workaround by
restore the formulas with a worksheet_change procedure and with a
errorhandler "on error goto 0" take away the error box about cirular
references you get if you drag n drop / cut/paste the A9 cell to A4.

I have a number of tables where the users will like to move cells around,
to
tables above and below. There will mostly be the "circular references
error
box" poping up all the time.

Question: I shouldn't take away all error messages like I've done now,
but
couldn't find a way to eliminate "error for circular references" only. Do
you or anybody else have a clue? I could't find a error number to check
with
in a error handler. Maybe the offset method Dave decribed is better...?

/Regards

"Dave Peterson" skrev i meddelandet
...
I think the developers had to make a decision. The one that they came
up
with
was if you cut a cell out of the middle of a range, then trust the user
to
know
that they don't want to change that formula.

But if they cut a cell from a cell in that formula (top or bottom
cell),
then
they figured that the user wanted to extend the range to include the
new
position of the pasted cell.

(It seems like a pretty reasonable approach to me--I'm not sure I'd
want
any
other way.)

Possible work arounds...
Use copy instead of Cut. then Clear the cell in the original location
after you
pasted.

modify the formula to be based on the position of the cell with the
formula.

In A8:
Instead of
=sum(a9:a13)
how about:
=SUM(OFFSET(A8,1,0,4,1))

Starting in A8, come down 1 row, to the right 0 columns for a total of
4
rows
and 1 column)

You may want to look at David McRitchie's site to see how he explains
using
=offset() to keep formulas from adjusting.

http://www.mvps.org/dmcritchie/excel/offset.htm

You might find something a little more useful.

Marie J-son wrote:

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and
in
A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in
A8
has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards

--

Dave Peterson


--

Dave Peterson





  #6   Report Post  
Dave Peterson
 
Posts: n/a
Default

If I understood your situation, I think I'd use the =indirect() version. I find
it easier to read/understand.

But inserting/deleting of rows/columns is a problem, then I'd use the =offset()
version.

I guess it depends <vbg.

Marie J-son wrote:

Thank you again!

Dave, I have tried both INDIRECT and OFFSET and they both work well. Do you
find INDIRECT better than OFFSET? It seems like OFFSET also keep the same
target sum area when I move around the cells, cut & paste etc. (I haven't
tried drag n' drop from other worksheets yet, hopefully that will not make a
differense).

It is not possible today to change rows or columns, it is locked, but maybe
I will develope it otherwice later on.

/Regards

"Dave Peterson" skrev i meddelandet
...
Ahhhh.

You always want your sum to point at the same range (A9:A13) no matter
where the
users drag and drop cells??

If that's the case, you can use something like this:

=SUM(INDIRECT("A9:A13"))

Be aware that if you insert/delete rows or columns, then this formula will
still
point at A9:A13. (that string "a9:a13" won't change like a cell
reference.



Marie J-son wrote:

Thank you Dave,

OK, maybe I should try offset. Right now however, I made a workaround by
restore the formulas with a worksheet_change procedure and with a
errorhandler "on error goto 0" take away the error box about cirular
references you get if you drag n drop / cut/paste the A9 cell to A4.

I have a number of tables where the users will like to move cells around,
to
tables above and below. There will mostly be the "circular references
error
box" poping up all the time.

Question: I shouldn't take away all error messages like I've done now,
but
couldn't find a way to eliminate "error for circular references" only. Do
you or anybody else have a clue? I could't find a error number to check
with
in a error handler. Maybe the offset method Dave decribed is better...?

/Regards

"Dave Peterson" skrev i meddelandet
...
I think the developers had to make a decision. The one that they came
up
with
was if you cut a cell out of the middle of a range, then trust the user
to
know
that they don't want to change that formula.

But if they cut a cell from a cell in that formula (top or bottom
cell),
then
they figured that the user wanted to extend the range to include the
new
position of the pasted cell.

(It seems like a pretty reasonable approach to me--I'm not sure I'd
want
any
other way.)

Possible work arounds...
Use copy instead of Cut. then Clear the cell in the original location
after you
pasted.

modify the formula to be based on the position of the cell with the
formula.

In A8:
Instead of
=sum(a9:a13)
how about:
=SUM(OFFSET(A8,1,0,4,1))

Starting in A8, come down 1 row, to the right 0 columns for a total of
4
rows
and 1 column)

You may want to look at David McRitchie's site to see how he explains
using
=offset() to keep formulas from adjusting.

http://www.mvps.org/dmcritchie/excel/offset.htm

You might find something a little more useful.

Marie J-son wrote:

Hi,

A problem came from a user today. Set up: IN A1: " =SUM(A2:A6) " and
in
A8:
" =SUM(A9:A13) " and fill in some figures in A9:A13.

Cut A10 and paste it to A4. everything is ok.
If I cut A9 you get "Circular Reference error, because the formula in
A8
has
changed to: " =SUM(A4:A13) " and the old SUM it still there in A8.

Why? Should it be that way, and what is the purpose? Any workarounds?

/Kind regards

--

Dave Peterson


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the color of all series in an excel chart in one go. Marielle Charts and Charting in Excel 2 May 3rd 23 07:45 PM
How to change the color of all series in an excel chart in one go. Mz2 Charts and Charting in Excel 1 January 20th 05 01:07 AM
Paste without including cell borders Heath Excel Worksheet Functions 1 December 29th 04 04:23 PM
Cell References in Functiona Mark T. Excel Worksheet Functions 1 December 11th 04 06:49 PM
Transferring cell content between workbooks using cell references Kiwi Mike Excel Discussion (Misc queries) 2 November 27th 04 11:31 PM


All times are GMT +1. The time now is 02:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"