The result you desired is logically correct but Tableau wont do it because you cant average 26.4%, N/A and N/A. If you are happy to sacrifice N/A then try following,
in the formula replace
"then -1" with "then NULL".
Check if average works now.
Also as Pat mentioned above a sample workbook always helps.
If this post assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution. Thank you.