I have a table that has clients names and the number of sessions in their respective packages. In another table, every time that client's name is entered, it uses vlookup and takes away a session from their package (keeping the original number of sessions in the first table).

My problem comes when their sessions run out (sessions countdown to zero), and the client signs up for another package. When the vlookup finds the name in from the first table, it returns the first name that appears, and not the second which I need.

Attached is a simplified version of my full workbook, which focuses solely on this issue. The blue highlighted cell needs to return a value of '3' and not '-1' (first it needs to realize a 'Table 2' value associated with 'Kelly' is '0'. it then needs to look for the next 'Kelly' in 'Table 1', and the associated value of '4' in cell B10.)

I would like this to be able to work if 'Kelly' appeared in 'Table 1' an unlimited amount of times.

sample.xlsx