4
Problem
I'm seeing the following inconsistent behavior in Excel 2016, when Copying/Cutting/Deleting data across filtered data:
- Copying Cells: Data gets "copied" from the visible cells only, and not from the filtered cells.
- Cutting Cells: Data gets "cut" from both - the visible, as well as the filtered cells.
- Pasting Cells: Data gets pasted on to both - the visible, as well as the filtered cells.
- Formatting/Deleting/Dragging Down/Other: Only the visible cells get affected, and not the filtered cells.
I see no good reason for this inconsistent behavior - is this a bug? Or is there some reason for this?
And more importantly, is there any way to get Excel to ignore hidden rows when Cutting and Pasting data, so that it is more consistent with the rest of the operations?
Demo
To try this out, please create the following table in Excel:
Next, filter out the rows with the Category = "Hide":
You should see something like:
Now, do the following:
- Select the visible cells in the Copy-From column (AAAA, BBBB, EEEE, FFFF), and Copy them (
CTRL-C
on Windows) - Go to the first empty cell under Copy-To, and Paste (
CTRL-V
on Windows) - Select the visible cells in the Cut-From column (GGGG, HHHH, KKKK, LLLL), and Cut them (
CTRL-X
on Windows) - Go to the first empty cell under Cut-To, and Paste (
CTRL-V
on Windows) - Select the visible cells in the Format column (MMMM, NNNN, QQQQ, RRRR), and make them Bold (
CTRL-B
on Windows) - Select the visible cells in the Delete column (SSSS, TTTT, WWWW, XXXX), and Delete them (
DEL
on Windows) - Select the first cell in the Drag column (January), and drag it down till the end of the column (till CCCC).
You should now see:
Now, clear the filter from the Category column, and you should see:
Based on the above, we can see several inconsistencies in how the filtered cells are handled:
- Copy: ignores filtered cells
- Cut: operates on filtered cells
- Paste: operates on filtered cells
- Delete: ignores filtered cells
- Formatting: ignores filtered cells
- Dragging data down: ignores filtered cells
Bonus
This behavior for filtered cells is different from how hidden cells are handled (to hide a cell, right click on the column or row header, and choose Hide
- this will hide the entire row or column). Hidden rows are included in all operations - that is, we can Copy, Cut, Paste, Delete, Format etc data if it is Hidden. The operations seem to behave inconsistently only for "Filtered" data.
Also, interestingly, when the data is hidden and not filtered, the Drag operation behaves differently as well - instead of repeating "January" everywhere, it behaves more intelligently, and shows February, March etc.
This is a happy case. The inconsistencies I encounter have absolutely no logic. I never determined why if you cut-paste a cell sometimes the cell borders are also moved and sometimes not. Seems totally random. – Overmind – 2017-05-29T12:34:11.417
I've always used excel more for viewing/analyzing information. Recently, I had to modify some attributes for a list of 190,000 entities - and after several weeks of working on it, when we finalized the list, I realized that something fishy was going on - and now I have to verify all 190,000 entities all over again! Luckily I haven't noticed too much random behavior at my end - but I'm starting to trust Excel a little less now. – Omaer – 2017-05-29T12:43:55.707
In a scenario like that I'd rather do some direct XML checks. It may be easier in some cases, but that needs some familiarity with XML. Anyway, the 'only copy visible cells' it's an option in Home > Find & Select -> Go To Special. Make sure it's not active. It should not be active by default. That may be the cause of point #1 in your list. – Overmind – 2017-05-29T12:55:27.290
Paste
has to be to a contiguous range. The cell "row" is not part of the copied data. Also, at least in 2016, theCut
operation has to be on a contiguous range. It is not possible to select only the visible cells, and perform aCut
. Perhaps you selected the entire column, thinking that you only selected the visible cells? Copy will exclude filtered cells, but not hidden cells. If you want to exclude hidden cells, you have to actually select just the visible cells as outlined in Help for the Copy function. – Ron Rosenfeld – 2017-05-29T19:36:48.053