@christianmaa, maybe this post discussed previously should help you build an if-statement:
if-statement