I've been working on a large data set and ran into what looks to be a very odd Excel bug.
I have isolated the problem down to a CountIf formula with a partially fixed range that is used to check whether an item is a duplicate in the rage above it e.g. =COUNTIF(C$7:C17,C17)
/ =COUNTIF(C$7:C18,C18)
copied down the full data set.
When copied down to a large number of rows (say 10,000) the formulas paste and and calculate fine, it is when you try and do anything else with them that the bug occurs. e.g. if you try and Delete / Clear all / copy and paste values on all the cells, the cell progress bar comes up and moves incredibly slowly for what should be a simple process.
If you use a CountIf for the whole range, clearing the value of the cells is pretty much instant. A SumIf for the same partial range also deletes immediately.
You should be able to replicate this yourself by using =RANDBETWEEN(0,10000)
for 10k rows, copying and pasting values for the random numbers to isolate them as being the issue and applying the partial range countif vs full range countif, then selecting the partial range cells and hitting delete. Note that the issue still arises if calculation is set to manual.
For reference, I am using Excel 2013 64bit on Windows 7 64 bit.
If anyone is up for confirming the bug or knows about an existing bug and potential solutions, it would be much appreciated.
Edit: Steps to reproduce the issue
- Create a new file (save and exit other Excel files!)
- To create the data to count, in A2 enter =RANDBETWEEN(0,10000) if you have a slow CPU or RANDBETWEEN(0,20000) if you have a faster CPU
- Copy A2 down to row A10k or A20k.
- Copy and paste values for column A
- In B2, enter =COUNTIF($A$1:A2,A2) and copy down
- Once sheet is fully calculated, select all the CountIf cells in column B and use the Clear All function. This is the stage where Excel seems to freeze for 2 minutes for 10k rows for me (have an i7 processor). If it is instant, then let me know what version of Excel and windows you are using.