Quote Originally Posted by Yongle View Post
The formula would yield that result if J9 is blank

So try
=IF(J9="","XXX",IF(J9>Agency_Contract!X9,J9-Agency_Contract!X9,VLOOKUP(D9,Agency_Contract,22,1)))
still returns value of J9 which i dont want to happen, J9 shows hours worked, J9 will never be blank at it shows hours worked the problem is if Agency Contract X9 is 0 thats the part of the formula that has the issue. if the cell X9 on Agency contract is 8 everything works great, but if 0 is entered the thats where its going wrong.