I'm having bit of trouble identifying what you consider as invalid/valid.

This is my take on it at the moment.
If Program Code is found in AY column of Dashboard, it is ok. Else error.
For Activity Code, in BA column.
For TWP Code it must be found in AW column?

Let me know if this is correct.