|We need to be careful here.|
When you say "If the answer to this formula is greater than J9", which part of the formula are you referring to?
The reason I ask is because of this:
1 - If the VLOOKUP does not find the "a", the result of that entire formula is going to be "".
2 - Excel will consider "" to be greater than any numeric value found in J9. It's based on how Excel handles text strings.
So the question is: Does "" count as a value to be checked against J9 or do you only want to check the result of B9/N9*O9-P9 against J9?
Assuming the latter, try this:
=IF(VLOOKUP(C9,'OTTA YEAR END 2010.xlsx'!ContractFunding,10,)="a", IF(B9/N9*O9-P9>J9 ,J9, B9/N9*O9-P9), "")
This should still return "" if the "a" isn't found, but will compare B9/N9*O9-P9 against J9 if the "a" is found.
Let us know...