In one of the recent releases, Alteryx enhanced the error message when there is an error within the Formula tool to display the error and the formula expression number.
Example:
Error: Formula (3): Parse Error at char(0): Unknown variable "TEST" (Expression #2)
My suggestion would be to label the different expressions within the formula tool with expression numbers. And/or code the expression name when there is an error message.