Whats the value the vlookup is supposed to return?
The range OP is looking for is between cat and cat, from what I can make out. Then dog to dog. And I assume others in between. OP can concatenate a VLOOKUP result with a unique identifier for each and then create a formula to calculate between the unique identifiers. All it basically does is allow it all to exist in one column as opposed to various columns. Although if column A is the only criteria that needs to be searched then your count should work to define the number of cells, with which the OP can then use to create a decent formula.
Must say, I've never had to work with such an ugly set of data before, so not entirely sure how to accomplish what the OP is after, let alone the OP being rather vague about it...

