Hmm?
Perhaps a bit of rationalisation of the data might be the best way?
1/. Use Dynamic Named Ranges to keep the calculations to the absolute minimum. (See the names manager.)
2/. Sort the data by "Especie" then by "IDPlot", or vice versa.
3/. Use Column C as a helper
In C2
Drag/Fill Down
4/. Put the unique IDPlot values in Column E.
Copy Column A and paste to E > Data > Remove Duplicates.
Then sort this list.
5/. Use Columns F:G as a helpers
In F2
Drag/Fill Down
In G1
Drag/Fill Down
6/. Columns C;H can be hidden, I've used a Grouping Button. (+/-)
7/. In J5 (Blacked out, this will always return "")
In K6
=IF(J6="","",COUNTIFS(IDPlot,J6,Especie,$J$1))
Drag/Fill both Down at least 5 more rows than in the "Unique IDPlot" list.
The rest is just COUNTIFS() with or without OFFSET()
All this would be much tidier, in my opinion, and more reliable, with the IDPlots formatted as I have shown
(Compare the List Order in the two files)
If this isn't possible to do then all the IDs as you have them MUST be text.
Hope this helps, at least it's a tad faster, over 11k plus rows, than our earlier efforts!
Bookmarks