I'm sure there is a way to do this but I have no idea how.
If you need to do it quick and no one else can tell us how, what about doing a DATA, SORT, by Y, THEN by number in the same search?
It should put them into numerical sequence and make it comparatively easy to manually count the sequential ones.