You seem to be chasing this one around a bit

Instead of this - per post#01:
=VLOOKUP(D9,Agency_Contract!C9:Y11,22,IF(J9>Agency_Contract!X9,J9-Agency_Contract!X9,0))
Try
=IF(J9>Agency_Contract!X9,J9-Agency_Contract!X9,VLOOKUP(D9,Agency_Contract,22,1))

Why?
If you translate the formula into what it is being asked to do
=VLOOKUP(D9,Agency_Contract!C9:Y11,22,IF(J9>Agency_Contract!X9,J9-Agency_Contract!X9,0))
tells Excel to
lookup cell D9[COMMA] in Agency_Contract Range C9:Y11 (ColC is the match)[COMMA] value we want is in column X [COMMA] HERE we expect a TRUE or FALSE argument BUT there is an if statement here
VLookUp.jpg