Created attachment 50243 [details]
Sample files data.ods and formula.ods
The CountIf function will miss the last non-empty cell in the data range, if 2 conditions are met:
1. The data range must be in an external file.
2. The data range must be "irregular", in that for example the first cell in the data range is empty.
I have enclosed 2 sample files data.ods and formula.ods. Formula.ods contains 4 columns with CountIf functions.
The J2 cell gets a 0, but it should be 1, like the rest. Its data range is in data.ods, in D1:D65536 - and D1 in that file is empty, confusing the CountIf function.
This may be related to bug 34242.
Also tried the files in 3.4.2 on Win7, with the same result.
*** Bug 40652 has been marked as a duplicate of this bug. ***
OS and Status due to Bug 40652
I did some further tests, it seems that it's a general "calculate external range" problem.
can you proceed? Please feel free to reassign (or reset Assignee to default) if it’s not your area. Please set Status to ASSIGNED if you accept this Bug.
*** Bug 41504 has been marked as a duplicate of this bug. ***
I'll try to find some time after Paris.
I'm taking a look at this.
Ah, I see what's wrong indeed. Luckily this is a trivial fix.
fixed on master.
The fix has been backported to the 3-4 branch. The fix should appear in 3.4.5.