After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 112847 - Autofill does not overwrite values; Copy Down/Right does in Excel
Autofill does not overwrite values; Copy Down/Right does in Excel
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 331469 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-05-12 16:38 UTC by Luke Hutchison
Modified: 2007-02-26 22:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Luke Hutchison 2003-05-12 16:38:12 UTC
In Excel, when you use Ctrl-D / Ctrl-R for Copy Down / Copy Right, any old
values in the selected range are overwritten by the copied value.  In
Gnumeric, Autofill does not overwrite old values which are already in the
range that is selected.

I think Gnumeric's method is probably safer, but not as useful.  When I
change formulas over a range, I find myself constantly having to select and
delete all but the top row of a range, then select the range including the
top row, then going Autofill, rather than just being able to do the
select/Autofill step.

I'm sure this has probably been discussed before, sorry if it has already
been discussed and the default behaviour was chosen as superior for some
reason.
Comment 1 Andreas J. Guelzow 2003-05-15 13:10:22 UTC
I never noticed that because whenever I autofill I do that by first
selecting the first cell and then dragging the autofill handle across
the range. This will overwrite everything in the range.

In the edit->fill->autofill version it does not refuse to overwrite
cells but it does not work with single cells: say 
A1:A15 are 1...15
B1     is  =A1*A1
B5     is  =34
selecting B1:B15 and choosing autofill will assume that B1:B5 is the
source and it will copy that into the next blocks of five cells, so B6
becomes =A6*A6 and B10 becomes 34...

If you have content in the whole range it will use the whole range as
its source and so nothing happens.

Perhaps we nee a second autofill menu item: "autofill from single cell"
Comment 2 Luke Hutchison 2003-05-15 16:25:52 UTC
Thanks for your explanation -- that makes a lot more sense now.

Hmm, I can see how the current behaviour could be very useful.  But in
the case where the cells that are copied are the whole range, Autofill
becomes a no-op, which is pretty useless, so perhaps in that case the
behaviour could change to do "Copy from first cell(s)".  That will
duplicate/merge most of the behaviour of both systems.

Selecting the first cell and dragging the corner down becomes
impractical when you have thousands of rows of the same formula.

Somehow though I kind of like the simplicity and explicitness of
Excel's "Copy Right" (Ctrl-R) / "Copy Down" (Ctrl-D) functions.  The
ability to overwrite what's already there is pretty important to
working efficiently with large numbers of formulae that change
frequently (e.g. during prototyping of a complex spreadsheet). 
Perhaps those two explicit options could be added to the Fill submenu
too (it's a small submenu anyway).
Comment 3 Morten Welinder 2004-07-16 16:06:09 UTC
Copy Down/Right have been implemented in cvs.  They will overwrite anything in
the target cell, possibly excluding comments.
Comment 4 Andreas J. Guelzow 2004-07-17 12:55:39 UTC
Where does one find Copy Down/Right?
Comment 5 Morten Welinder 2004-07-17 13:50:22 UTC
Keys Ctrl-D and Ctrl-R only.  ("Copy down" is more like "copy from cell above",
btw.)
Comment 6 Andreas J. Guelzow 2004-11-14 07:06:35 UTC
I think we should ahve some neun item for these. They seem to be quite useful.
Comment 7 Andreas J. Guelzow 2004-11-16 14:10:10 UTC
I guess I can't type. This was supposed to be:

I think we should have some menu items for these.
Comment 8 Frank Arnold 2005-02-20 19:17:18 UTC
If this will get into toolbars or menus somehow, please change the description.
I've struggled with translating the labels for this (Copy Down, Copy Right) and
had a look at the sources. At this point I've got some self-doubts. But
fortunatly found this one... ;)

So it would be better to name this "Copy from left" and "Copy from above". At
least a comment for translators would be nice.
Comment 9 Luke Hutchison 2005-02-20 22:42:58 UTC
Yes, another great (mis-)feature of the English language :-)  It really means
(as you figured out from the source), "Copy to all cells in the Down/Right
direction", not "Copy the thing called 'Down'/'Right'".  The only way the
meaning is not ambiguous is that only one of the two possible interpretations in
English makes sense...  We should all give up on English and use source code to
communicate instead :-)

This feature originated in Excel, where the shortcuts are the (unfortunately
unlocalizable) Ctrl-D and Ctrl-R.  It is a feature used by a lot of people. 
Perhaps a better name though is "Fill Down" and "Fill to Right".  That way their
English names will still match the shortcuts that a lot of migrating Excel users
use.  "Copy from left" doesn't match Ctrl-R very well -- but perhaps us English
speakers need to learn to deal with non-mnemonic keyboard shortcuts, like the
rest of the non-English speaking world has forced on them by us insensitive
English speakers :-(
Comment 10 Luke Hutchison 2005-05-13 19:40:48 UTC
There seems to be a strange problem with Ctrl-R and Ctrl-D.  I type on a Dvorak
keyboard, and I have seen one Gnumeric installation where Ctrl + the actual R
key (which is bound to P on Dvorak) works for copy-right, as well as Ctrl-R
(where R is bound to the O key).  The same happens for Ctrl-D: the H key is
bound to D on Dvorak.

This creates a problem, because Ctrl-P no longer works for Print, as it is
rebound to "Copy-Right".

In my current Gnumeric installation, I can't duplicate this problem (neither
Ctrl-R nor Ctrl-D works using either keyboard layout).  Ctrl-P does not print
either, and I think it is supposed to (unless this keyboard binding was
intentionally removed in the 1.4.x series?  I think it used to be there...)  It
doesn't even show Ctrl-P next to Print... in the menu.

 
Comment 11 Morten Welinder 2005-05-13 19:45:24 UTC
Whatever the problem for the Dvorak keyboard was, it would be a gtk+ problem
and not a gnumeric problem.  You'll have to isolate and file under gtk+.

Ctrl-P was unintentionally lost of 1.4.x at some point and fixed here:

2005-03-12  Jon K Hellan  <hellan@acm.org>

	* src/wbcg-actions.c: Add <Ctrl>+P accelerator for print.
Comment 12 Jody Goldberg 2005-09-25 04:56:23 UTC
What is left here now that copy right/down is implemented ?
Comment 13 Luke Hutchison 2005-09-25 05:07:52 UTC
I don't think there's a UI for this (or even a mention in the menus), see
comment 5 - comment 8.  So there's no way for the user to know this exists
unless they are used to the Excel convention or look in the docs. 
(=>discoverability.)  The Fill menu is pretty small, two more options probably
won't hurt, especially given their usefulness and common usage among Excel users.

This is also either not functional or not present in 1.4.3, I'm assuming when it
was added to CVS on 2004-07-16 (Comment #3) that that was after the 1.5 branch,
so it is not intended to work in 1.4.x?  (I haven't tried 1.5.x recently.) 
Otherwise, other than the UI issue, I agree that there's nothing else to be
done.  Thanks!
Comment 14 Luke Hutchison 2006-01-12 21:52:55 UTC
Not sure why this bug was still in NEEDINFO state, presumably the state didn't change when I added Comment #13.
Comment 15 Gerald B Cox 2006-02-17 18:30:25 UTC
*** Bug 331469 has been marked as a duplicate of this bug. ***
Comment 16 Morten Welinder 2006-02-17 18:36:21 UTC
Ok, it seems that copy-down in Excel has two different functions.

1. The one we have: copy from the cell above.
2. When more that one row is selected, it copies the top one into the rest.

I guess we can do 2 without too much hassle.
--> enhancement.
Comment 17 Oliver Burnett-Hall 2007-02-23 00:45:44 UTC
(In reply to comment #16)
> Ok, it seems that copy-down in Excel has two different functions.
> 1. The one we have: copy from the cell above.
> 2. When more that one row is selected, it copies the top one into the rest.

As far as I can work out, for copy down (Control-D), Excel's behaviour is (tested in Excel 2003):

1) If the selection is a single area, and this single area consists of a single row, and this is not the top row: copy into each cell in the selection the expression in the cell immediately above it.

2) If not, for each column in the selection, copy the expression in the topmost cell in the selection into all other selected cells in that column (even if the selections are non-contiguous).

For copy right (Control-R) this all works exactly the same, except rotated 90 degrees anticlockwise.

This generally does what you'd expect it to -- select a single row and it copies from above it; select multiple rows and it copies the top row downwards.

I think the best behaviour could go a little beyond Excel's by choosing to copy from above the selection if the selection has multiple areas, but all are in a single row (e.g. selecting A3 and C3 and hitting Control-D would copy the values from A2 and C2 into them).  Maybe you could go even further by still copying from the cell above if there are multiple rows in the selection, but no column has more than one row selected (but that might start to get a bit non-intuitive).

At the moment Gnumeric's copy down/right only works if a single cell is selected.  This is definitely in need of improvement -- for me Control-D and Control-R are the instinctive way of copying formulas around, and they don't work most of the time.
Comment 18 Morten Welinder 2007-02-26 22:06:17 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.